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.
Modifier and Type | Method and Description |
---|---|
void |
clearQuantity()
Removes the quantity.
|
void |
clearStock()
Removes the stock.
|
void |
clearUnitType()
Removes the unit type.
|
IngredientFormRecord |
getIngredientFormRecord(Type ingredientRecordType)
Gets the
IngredientFormRecord corresponding to the
given ingredient record Type. |
Metadata |
getQuantityMetadata()
Gets the metadata for the quantity.
|
Metadata |
getStockMetadata()
Gets the metadata for the stock.
|
Metadata |
getUnitTypeMetadata()
Gets the metadata for the unit type.
|
void |
setQuantity(long quantity)
Sets the quantity.
|
void |
setStock(Id stockId)
Sets the stock.
|
void |
setUnitType(Type unitType)
Sets the unit type.
|
clearDescription, clearDisplayName, clearGenusType, getDescriptionMetadata, getDisplayNameMetadata, getGenusTypeMetadata, setDescription, setDisplayName, setGenusType
getRequiredRecordTypes
getRecordTypes, hasRecordType
getDefaultLocale, getInvalidMetadata, getJournalCommentMetadata, getLocales, getValidationMessages, isForUpdate, isValid, setJournalComment, setLocale
getId, isCurrent
Metadata getQuantityMetadata()
mandatory
- This method must be implemented. void setQuantity(long quantity)
quantity
- the new quantityInvalidArgumentException
- quantity
is
invalidNoAccessException
- Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. void clearQuantity()
NoAccessException
- Metadata.isRequired()
is true
or Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. Metadata getUnitTypeMetadata()
mandatory
- This method must be implemented. void setUnitType(Type unitType)
unitType
- the new unit typeInvalidArgumentException
- unitType
is
invalidNoAccessException
- Metadata.isReadOnly()
is true
NullArgumentException
- unitType
is
null
mandatory
- This method must be implemented. void clearUnitType()
NoAccessException
- Metadata.isRequired()
is true
or Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. Metadata getStockMetadata()
mandatory
- This method must be implemented. void setStock(Id stockId)
stockId
- the new stockInvalidArgumentException
- stockId
is
invalidNoAccessException
- Metadata.isReadOnly()
is true
NullArgumentException
- stockId
is
null
mandatory
- This method must be implemented. void clearStock()
NoAccessException
- Metadata.isRequired()
is true
or Metadata.isReadOnly()
is true
mandatory
- This method must be implemented. IngredientFormRecord getIngredientFormRecord(Type ingredientRecordType) throws OperationFailedException, PermissionDeniedException
IngredientFormRecord
corresponding to the
given ingredient record Type.
ingredientRecordType
- an ingredient record typeNullArgumentException
- ingredientRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredUnsupportedException
-
hasRecordType(ingredientRecordType)
is false
mandatory
- This method must be implemented.