ch.systemsx.cisd.openbis.generic.shared.api.v1.dto
Class SearchCriteria.MatchClause

java.lang.Object
  extended by 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(value="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

Method Summary
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()
           
 SearchCriteria.MatchClauseFieldType getFieldType()
          The field type this MatchClause matches against.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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 against
mode - 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.


getDesiredValue

public java.lang.String getDesiredValue()

getCompareMode

public SearchCriteria.CompareMode getCompareMode()

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