Class SearchCriteria.MatchClause
- java.lang.Object
-
- ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchClause
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
SearchCriteria.AnyFieldMatchClause
,SearchCriteria.AnyPropertyMatchClause
,SearchCriteria.AttributeMatchClause
,SearchCriteria.PropertyMatchClause
,SearchCriteria.TimeAttributeMatchClause
- Enclosing class:
- SearchCriteria
@JsonObject("MatchClause") public static class SearchCriteria.MatchClause extends java.lang.Object implements java.io.Serializable
A specification of one field (either property or attribute) and desired value for that field.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MatchClause(SearchCriteria.MatchClauseFieldType fieldType, java.lang.String fieldCode, java.lang.String desiredValue, SearchCriteria.CompareMode compareMode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SearchCriteria.MatchClause
createAnyFieldMatch(java.lang.String desiredValue)
Factory method to create a MatchClause matching against any property or attribute.static SearchCriteria.MatchClause
createAnyPropertyMatch(java.lang.String desiredValue)
Factory method to create a MatchClause matching against any property.static SearchCriteria.MatchClause
createAttributeMatch(SearchCriteria.MatchClauseAttribute attribute, java.lang.String desiredValue)
Factory method to create a MatchClause matching against a specific attribute.static SearchCriteria.MatchClause
createPropertyMatch(java.lang.String propertyCode, java.lang.String desiredValue)
Factory method to create a MatchClause matching against a specific property.static SearchCriteria.MatchClause
createTimeAttributeMatch(SearchCriteria.MatchClauseTimeAttribute attribute, SearchCriteria.CompareMode mode, java.lang.String date, java.lang.String timezone)
Factory method to create a MatchClause matching against registration or modification date.boolean
equals(java.lang.Object obj)
static java.lang.String
escape(java.lang.String s)
Returns a String where those characters that Lucene expects to be escaped are escaped by a preceding\
.SearchCriteria.CompareMode
getCompareMode()
java.lang.String
getDesiredValue()
protected java.lang.String
getFieldCode()
The code of the field.SearchCriteria.MatchClauseFieldType
getFieldType()
The field type this MatchClause matches against.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
MatchClause
protected MatchClause(SearchCriteria.MatchClauseFieldType fieldType, java.lang.String fieldCode, java.lang.String desiredValue, SearchCriteria.CompareMode compareMode)
-
-
Method Detail
-
createPropertyMatch
public static SearchCriteria.MatchClause createPropertyMatch(java.lang.String propertyCode, java.lang.String desiredValue)
Factory method to create a MatchClause matching against a specific property.- Parameters:
propertyCode
- The name of the property to compare against.desiredValue
- The desired value for the property.
-
createAttributeMatch
public static SearchCriteria.MatchClause createAttributeMatch(SearchCriteria.MatchClauseAttribute attribute, java.lang.String desiredValue)
Factory method to create a MatchClause matching against a specific attribute.- Parameters:
attribute
- The attribute to compare against.desiredValue
- The desired value for the attribute.
-
createTimeAttributeMatch
public static SearchCriteria.MatchClause createTimeAttributeMatch(SearchCriteria.MatchClauseTimeAttribute attribute, SearchCriteria.CompareMode mode, java.lang.String date, java.lang.String timezone)
Factory method to create a MatchClause matching against registration or modification date.- Parameters:
attribute
- The attribute to compare againstmode
- The kind of comparison (<=, ==, >=)date
- The date to compare against, format YYYY-MM-DD
-
createAnyPropertyMatch
public static SearchCriteria.MatchClause createAnyPropertyMatch(java.lang.String desiredValue)
Factory method to create a MatchClause matching against any property.- Parameters:
desiredValue
- The desired value for a property.
-
createAnyFieldMatch
public static SearchCriteria.MatchClause createAnyFieldMatch(java.lang.String desiredValue)
Factory method to create a MatchClause matching against any property or attribute.- Parameters:
desiredValue
- The desired value for a property or an attribute.
-
escape
public static java.lang.String escape(java.lang.String s)
Returns a String where those characters that Lucene expects to be escaped are escaped by a preceding\
.Copy of Lucene's
QueryParser.escape()
method.
-
getFieldType
public SearchCriteria.MatchClauseFieldType getFieldType()
The field type this MatchClause matches against. Could be either a property or attribute.
-
getFieldCode
protected java.lang.String getFieldCode()
The code of the field.
-
getDesiredValue
public java.lang.String getDesiredValue()
-
getCompareMode
public SearchCriteria.CompareMode getCompareMode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-