Class DefaultIngredientComponentStorageHandler

java.lang.Object
org.cyclops.commoncapabilities.api.ingredient.storage.DefaultIngredientComponentStorageHandler
All Implemented Interfaces:
IIngredientComponentStorageHandler

public class DefaultIngredientComponentStorageHandler extends Object implements IIngredientComponentStorageHandler
Default implementation of IIngredientComponentStorageHandler.
  • Constructor Details

    • DefaultIngredientComponentStorageHandler

      public DefaultIngredientComponentStorageHandler()
  • Method Details

    • getComponents

      public Collection<IngredientComponent<?,?>> getComponents()
      Specified by:
      getComponents in interface IIngredientComponentStorageHandler
      Returns:
      The ingredient component types this handler holds.
    • getStorage

      @Nullable public <T, M> IIngredientComponentStorage<T,M> getStorage(IngredientComponent<T,M> ingredientComponent)
      Description copied from interface: IIngredientComponentStorageHandler
      Get the storage for the given ingredient component,
      Specified by:
      getStorage in interface IIngredientComponentStorageHandler
      Type Parameters:
      T - The instance type.
      M - The matching condition parameter, may be Void. Instances MUST properly implement the equals method.
      Parameters:
      ingredientComponent - The ingredient component.
      Returns:
      The ingredient component storage, or null if it is not available.
    • setStorage

      public <T, M> void setStorage(IngredientComponent<T,M> ingredientComponent, @Nullable IIngredientComponentStorage<T,M> storage)
      Set the storage for the given ingredient component.
      Type Parameters:
      T - The instance type.
      M - The matching condition parameter, may be Void. Instances MUST properly implement the equals method.
      Parameters:
      ingredientComponent - The ingredient component.
      storage - The ingredient component storage, or null if it should be removed.