Class SearchCriteria.MatchClause

java.lang.Object
ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchClause
All Implemented Interfaces:
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 Object implements Serializable
A specification of one field (either property or attribute) and desired value for that field.
See Also:
  • Constructor Details

  • Method Details

    • createPropertyMatch

      public static SearchCriteria.MatchClause createPropertyMatch(String propertyCode, 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, 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, String date, 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 (invalid input: '<'=, ==, >=)
      date - The date to compare against, format YYYY-MM-DD
    • createAnyPropertyMatch

      public static SearchCriteria.MatchClause createAnyPropertyMatch(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(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 String escape(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 String getFieldCode()
      The code of the field.
    • getDesiredValue

      public String getDesiredValue()
    • getCompareMode

      public SearchCriteria.CompareMode getCompareMode()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object