Class SearchCriteria
java.lang.Object
ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA MatchClause for checking that any of the properties or attributes equals a desired value.static classA MatchClause for checking that any of the properties equals a desired value.static classA MatchClause for checking that an attribute equals a desired value.static enumstatic classA specification of one field (either property or attribute) and desired value for that field.static enumAn enum listing the different attributes that can be compared against.static enumAn enum listing the different field types that can be compared against.static enumAn enum listing the different attributes containing time values that can be compared against.static classA MatchClause for checking that a property equals a desired value.static enumOperators for combining MatchClause objects.static classA MatchClause for comparing a time attribute to a specified value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMatchClause(SearchCriteria.MatchClause criterion) Add a new match clause.voidaddSubCriteria(SearchSubCriteria criteria) Add a new sub search criteria.booleanGet a list of MatchClause objects this SearchCriteria will match against.Gets the operator for combining MatchClause objects.Get a list ofSearchSubCriteriaobjects for this SearchCriteria.inthashCode()voidsetOperator(SearchCriteria.SearchOperator operator) Set the operator for combining MatchClause objects.toString()
-
Constructor Details
-
SearchCriteria
public SearchCriteria()
-
-
Method Details
-
getOperator
Gets the operator for combining MatchClause objects. Default value isSearchCriteria.SearchOperator.MATCH_ALL_CRITERIA. -
getMatchClauses
Get a list of MatchClause objects this SearchCriteria will match against. -
getSubCriterias
Get a list ofSearchSubCriteriaobjects for this SearchCriteria. -
equals
-
hashCode
public int hashCode() -
toString