Interface IngredientForm
- All Superinterfaces:
Extensible, Identifiable, OsidBrowsableForm, OsidExtensibleForm, OsidForm, OsidIdentifiableForm, OsidObjectForm, OsidSubjugateableForm, Suppliable
- All Known Subinterfaces:
IngredientBatchForm
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 Summary
Modifier and TypeMethodDescriptionvoidRemoves the quantity.voidRemoves the stock.voidRemoves the unit type.getIngredientFormRecord(Type ingredientRecordType) Gets theIngredientFormRecordcorresponding to the given ingredient recordType.Gets the metadata for the quantity.Gets the metadata for the stock.Gets the metadata for the unit type.voidsetQuantity(long quantity) Sets the quantity.voidSets the stock.voidsetUnitType(Type unitType) Sets the unit type.Methods inherited from interface Extensible
getRecordTypes, hasRecordTypeModifier and TypeMethodDescriptionGets the record types available in this object.booleanhasRecordType(Type recordType) Tests if this object supports the given recordType.Methods inherited from interface Identifiable
getId, isCurrentMethods inherited from interface OsidExtensibleForm
getRequiredRecordTypesModifier and TypeMethodDescriptionGets the minimum required record types for successful submission of thisOsidForm.Methods inherited from interface OsidForm
getDefaultLocale, getInvalidMetadata, getJournalCommentMetadata, getLocales, getValidationMessages, isForUpdate, isValid, setJournalComment, setLocaleModifier and TypeMethodDescriptionGets a default locale for the form.Metadata[]Gets a list of metadata for the elements in this form which are not valid.Gets the metadata for the comment corresponding to this form submission.Gets the locales available for this form.Gets text messages corresponding to additional instructions to pass form validation.booleanTests if this form is for an update operation.booleanisValid()Tests if this form is in a valid state for submission.voidsetJournalComment(String comment) Sets a comment.voidSpecifies a language and script type for the form.Methods inherited from interface OsidObjectForm
clearDescription, clearDisplayName, clearGenusType, getDescriptionMetadata, getDisplayNameMetadata, getGenusTypeMetadata, setDescription, setDisplayName, setGenusTypeModifier and TypeMethodDescriptionvoidClears the description.voidClears the display name.voidClears the genus type.Gets the metadata for a description.Gets the metadata for a display name.Gets the metadata for a genus type.voidsetDescription(String description) Sets a description.voidsetDisplayName(String displayName) Sets a display name.voidsetGenusType(Type genusType) Sets a genus.
-
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-quantityis invalidNoAccessException-Metadata.isReadOnly()istrue- Compliance:
mandatory- This method must be implemented.
-
clearQuantity
void clearQuantity()Removes the quantity.- Throws:
NoAccessException-Metadata.isRequired()istrueorMetadata.isReadOnly()istrue- 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
Sets the unit type.- Parameters:
unitType- the new unit type- Throws:
InvalidArgumentException-unitTypeis invalidNoAccessException-Metadata.isReadOnly()istrueNullArgumentException-unitTypeisnull- Compliance:
mandatory- This method must be implemented.
-
clearUnitType
void clearUnitType()Removes the unit type.- Throws:
NoAccessException-Metadata.isRequired()istrueorMetadata.isReadOnly()istrue- 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
Sets the stock.- Parameters:
stockId- the new stock- Throws:
InvalidArgumentException-stockIdis invalidNoAccessException-Metadata.isReadOnly()istrueNullArgumentException-stockIdisnull- Compliance:
mandatory- This method must be implemented.
-
clearStock
void clearStock()Removes the stock.- Throws:
NoAccessException-Metadata.isRequired()istrueorMetadata.isReadOnly()istrue- Compliance:
mandatory- This method must be implemented.
-
getIngredientFormRecord
IngredientFormRecord getIngredientFormRecord(Type ingredientRecordType) throws OperationFailedException, PermissionDeniedException Gets theIngredientFormRecordcorresponding to the given ingredient recordType.- Parameters:
ingredientRecordType- an ingredient record type- Returns:
- the ingredient form record
- Throws:
NullArgumentException-ingredientRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-hasRecordType(ingredientRecordType)isfalse- Compliance:
mandatory- This method must be implemented.
-