Class SearchCriteria

  • All Implemented Interfaces:
    java.io.Serializable

    @JsonObject("SearchCriteria")
    public class SearchCriteria
    extends java.lang.Object
    implements java.io.Serializable
    A (mutable) object representing the specification of a search. A search is specified by MatchClause objects and an operator for combining match clauses. Additionally sub criteria can be added for entities connected with the main entity object.

    A MatchClause is made up of a property or attribute to compare against and a desired value for that property or attribute.

    Example:

    Match all of the following clauses:
    • Attribute('TYPE') = [desired value]
    • Property('PROPERTY_CODE') = [desired value]

    Looks like this:

    SearchCriteria sc = new SearchCriteria();
    sc.addMatchClause(MatchClause.createAttributeMatch(MatchClauseAttribute.TYPE, "A_TYPE_CODE"));
    sc.addMatchClause(MatchClause.createPropertyMatch("PROPERTY_CODE", "a property value"));

    Extension of the previous example with with experiment criteria:

    SearchCriteria ec = new SearchCriteria();
    ec.addMatchClause(MatchClause.createAttributeMatch(MatchClauseAttribute.CODE, "EXP_CODE"));
    sc.addSubCriteria(SearchSubCriteria.createExperimentCriteria(ec));

    For other sub criteria types see SearchSubCriteria.

    See Also:
    SearchSubCriteria, Serialized Form
    • Constructor Detail

      • SearchCriteria

        public SearchCriteria()
    • Method Detail

      • getMatchClauses

        public java.util.List<SearchCriteria.MatchClause> getMatchClauses()
        Get a list of MatchClause objects this SearchCriteria will match against.
      • addSubCriteria

        public void addSubCriteria​(SearchSubCriteria criteria)
        Add a new sub search criteria.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object