Interface IngredientQuery

All Superinterfaces:
Extensible, OsidBrowsableQuery, OsidExtensibleQuery, OsidIdentifiableQuery, OsidObjectQuery, OsidQuery, OsidSubjugateableQuery, Suppliable

public interface IngredientQuery extends OsidObjectQuery, OsidSubjugateableQuery

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 .

  • Method Details

    • matchQuantity

      void matchQuantity(long low, long high, boolean match)
      Matches ingredients with quantity between the given range inclusive.
      Parameters:
      low - starting of range
      high - end of range
      match - true for a positive match, false for a negative match
      Throws:
      InvalidArgumentException - low is greater than high
      Compliance:
      mandatory - This method must be implemented.
    • matchAnyQuantity

      void matchAnyQuantity(boolean match)
      Matches ingredients with any quantity.
      Parameters:
      match - true to match ingredients with any quantity, false to 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

      void matchUnitType(Type unitType, boolean match)
      Matches ingredients with a unit type.
      Parameters:
      unitType - a unit type
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - unitType is null
      Compliance:
      mandatory - This method must be implemented.
    • matchAnyUnitType

      void matchAnyUnitType(boolean match)
      Matches ingredients with any unit type.
      Parameters:
      match - true to match ingredients with any unit type, false to 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

      void matchStockId(Id stockId, boolean match)
      Sets the stock Id for this query.
      Parameters:
      stockId - the stock Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - stockId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearStockIdTerms

      void clearStockIdTerms()
      Clears the stock Id query terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsStockQuery

      boolean supportsStockQuery()
      Tests if a StockQuery is available.
      Returns:
      true if a stock query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getStockQuery

      StockQuery getStockQuery()
      Gets the query for a stock. Multiple retrievals produce a nested OR term.
      Returns:
      the stock query
      Throws:
      UnimplementedException - supportsStockQuery() is false
      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 - true to match ingredients with any stock, false to 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, PermissionDeniedException
      Gets the ingredient query record corresponding to the given Ingredient record Type . Multiple record retrievals produce a nested OR term.
      Parameters:
      ingredientRecordType - an ingredient record type
      Returns:
      the ingredient query 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.