Interface IngredientForm

All Superinterfaces:
Extensible, Identifiable, OsidBrowsableForm, OsidExtensibleForm, OsidForm, OsidIdentifiableForm, OsidObjectForm, OsidSubjugateableForm, Suppliable
All Known Subinterfaces:
IngredientBatchForm

public interface IngredientForm extends OsidObjectForm, OsidSubjugateableForm

This is the form for creating and updating Ingredients. Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the DirectionAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

  • Method Details

    • getQuantityMetadata

      Metadata getQuantityMetadata()
      Gets the metadata for the quantity.
      Returns:
      metadata for the quantity
      Compliance:
      mandatory - This method must be implemented.
    • setQuantity

      void setQuantity(long quantity)
      Sets the quantity.
      Parameters:
      quantity - the new quantity
      Throws:
      InvalidArgumentException - quantity is invalid
      NoAccessException - Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • clearQuantity

      void clearQuantity()
      Removes the quantity.
      Throws:
      NoAccessException - Metadata.isRequired() is true or Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • getUnitTypeMetadata

      Metadata getUnitTypeMetadata()
      Gets the metadata for the unit type.
      Returns:
      metadata for the unit type
      Compliance:
      mandatory - This method must be implemented.
    • setUnitType

      void setUnitType(Type unitType)
      Sets the unit type.
      Parameters:
      unitType - the new unit type
      Throws:
      InvalidArgumentException - unitType is invalid
      NoAccessException - Metadata.isReadOnly() is true
      NullArgumentException - unitType is null
      Compliance:
      mandatory - This method must be implemented.
    • clearUnitType

      void clearUnitType()
      Removes the unit type.
      Throws:
      NoAccessException - Metadata.isRequired() is true or Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • getStockMetadata

      Metadata getStockMetadata()
      Gets the metadata for the stock.
      Returns:
      metadata for the stock
      Compliance:
      mandatory - This method must be implemented.
    • setStock

      void setStock(Id stockId)
      Sets the stock.
      Parameters:
      stockId - the new stock
      Throws:
      InvalidArgumentException - stockId is invalid
      NoAccessException - Metadata.isReadOnly() is true
      NullArgumentException - stockId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearStock

      void clearStock()
      Removes the stock.
      Throws:
      NoAccessException - Metadata.isRequired() is true or Metadata.isReadOnly() is true
      Compliance:
      mandatory - This method must be implemented.
    • getIngredientFormRecord

      IngredientFormRecord getIngredientFormRecord(Type ingredientRecordType) throws OperationFailedException, PermissionDeniedException
      Gets the IngredientFormRecord corresponding to the given ingredient record Type.
      Parameters:
      ingredientRecordType - an ingredient record type
      Returns:
      the ingredient form record
      Throws:
      NullArgumentException - ingredientRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure occurred
      UnsupportedException - hasRecordType(ingredientRecordType) is false
      Compliance:
      mandatory - This method must be implemented.