Interface IngredientQuery
- All Superinterfaces:
Extensible, OsidBrowsableQuery, OsidExtensibleQuery, OsidIdentifiableQuery, OsidObjectQuery, OsidQuery, OsidSubjugateableQuery, Suppliable
This is the query for searching ingredients. Each method match
specifies an AND term while multiple invocations of the same
method produce a nested OR.
Like all OsidQueries, IngredientQuery is stateful and
must not be accessed by multiple processing threads.
-
Method Summary
Modifier and TypeMethodDescriptionvoidClears the quantity query terms.voidClears the stockIdquery terms.voidClears the stock query terms.voidClears the unit type query terms.getIngredientQueryRecord(Type ingredientRecordType) Gets the ingredient query record corresponding to the givenIngredientrecordType.Gets the query for a stock.voidmatchAnyQuantity(boolean match) Matches ingredients with any quantity.voidmatchAnyStock(boolean match) Matches ingredients with any stock.voidmatchAnyUnitType(boolean match) Matches ingredients with any unit type.voidmatchQuantity(long low, long high, boolean match) Matches ingredients with quantity between the given range inclusive.voidmatchStockId(Id stockId, boolean match) Sets the stockIdfor this query.voidmatchUnitType(Type unitType, boolean match) Matches ingredients with a unit type.booleanTests if aStockQueryis available.Methods inherited from interface Extensible
getRecordTypes, hasRecordTypeMethods inherited from interface OsidExtensibleQuery
clearRecordTerms, matchAnyRecord, matchRecordTypeMethods inherited from interface OsidIdentifiableQuery
clearIdTerms, matchIdMethods inherited from interface OsidObjectQuery
clearCommentIdTerms, clearCommentTerms, clearCreditIdTerms, clearCreditTerms, clearDescriptionTerms, clearDisplayNameTerms, clearGenusTypeTerms, clearJournalEntryIdTerms, clearJournalEntryTerms, clearParentGenusTypeTerms, clearRelationshipIdTerms, clearRelationshipPeerIdTerms, clearRelationshipTerms, clearStateIdTerms, clearStateTerms, clearStatisticTerms, clearSubjectIdTerms, clearSubjectRelevancyTerms, clearSubjectTerms, getCommentQuery, getCreditQuery, getJournalEntryQuery, getRelationshipQuery, getStateQuery, getStatisticQuery, getSubjectQuery, getSubjectRelevancyQuery, matchAnyComment, matchAnyCredit, matchAnyDescription, matchAnyDisplayName, matchAnyGenusType, matchAnyJournalEntry, matchAnyRelationship, matchAnyState, matchAnyStatistic, matchAnySubject, matchCommentId, matchCreditId, matchDescription, matchDisplayName, matchGenusType, matchJournalEntryId, matchParentGenusType, matchRelationshipId, matchRelationshipPeerId, matchStateId, matchSubjectId, supportsCommentQuery, supportsCreditQuery, supportsJournalEntryQuery, supportsRelationshipQuery, supportsStateQuery, supportsStatisticQuery, supportsSubjectQuery, supportsSubjectRelevancyQueryMethods inherited from interface OsidQuery
clearAnyTerms, clearKeywordTerms, getStringMatchTypes, matchAny, matchKeyword, supportsStringMatchType
-
Method Details
-
matchQuantity
void matchQuantity(long low, long high, boolean match) Matches ingredients with quantity between the given range inclusive.- Parameters:
low- starting of rangehigh- end of rangematch-truefor a positive match,falsefor a negative match- Throws:
InvalidArgumentException-lowis greater thanhigh- Compliance:
mandatory- This method must be implemented.
-
matchAnyQuantity
void matchAnyQuantity(boolean match) Matches ingredients with any quantity.- Parameters:
match-trueto match ingredients with any quantity,falseto match ingredients with no quantity- Compliance:
mandatory- This method must be implemented.
-
clearQuantityTerms
void clearQuantityTerms()Clears the quantity query terms.- Compliance:
mandatory- This method must be implemented.
-
matchUnitType
Matches ingredients with a unit type.- Parameters:
unitType- a unit typematch-truefor a positive match,falsefor a negative match- Throws:
NullArgumentException-unitTypeisnull- Compliance:
mandatory- This method must be implemented.
-
matchAnyUnitType
void matchAnyUnitType(boolean match) Matches ingredients with any unit type.- Parameters:
match-trueto match ingredients with any unit type,falseto match ingredients with no unit type- Compliance:
mandatory- This method must be implemented.
-
clearUnitTypeTerms
void clearUnitTypeTerms()Clears the unit type query terms.- Compliance:
mandatory- This method must be implemented.
-
matchStockId
Sets the stockIdfor this query.- Parameters:
stockId- the stockIdmatch-truefor a positive match,falsefor a negative match- Throws:
NullArgumentException-stockIdisnull- Compliance:
mandatory- This method must be implemented.
-
clearStockIdTerms
void clearStockIdTerms()Clears the stockIdquery terms.- Compliance:
mandatory- This method must be implemented.
-
supportsStockQuery
boolean supportsStockQuery()Tests if aStockQueryis available.- Returns:
trueif a stock query is available,falseotherwise- Compliance:
mandatory- This method must be implemented.
-
getStockQuery
StockQuery getStockQuery()Gets the query for a stock. Multiple retrievals produce a nestedORterm.- Returns:
- the stock query
- Throws:
UnimplementedException-supportsStockQuery()isfalse- Compliance:
optional- This method must be implemented if {@code supportsStockQuery()} is {@code true}.
-
matchAnyStock
void matchAnyStock(boolean match) Matches ingredients with any stock.- Parameters:
match-trueto match ingredients with any stock,falseto match ingredients with no stock- Compliance:
mandatory- This method must be implemented.
-
clearStockTerms
void clearStockTerms()Clears the stock query terms.- Compliance:
mandatory- This method must be implemented.
-
getIngredientQueryRecord
IngredientQueryRecord getIngredientQueryRecord(Type ingredientRecordType) throws OperationFailedException Gets the ingredient query record corresponding to the givenIngredientrecordType. Multiple record retrievals produce a nestedORterm.- Parameters:
ingredientRecordType- an ingredient record type- Returns:
- the ingredient query record
- Throws:
NullArgumentException-ingredientRecordTypeisnullOperationFailedException- unable to complete requestUnsupportedException-hasRecordType(ingredientRecordType)isfalse- Compliance:
mandatory- This method must be implemented.
-