Class Criterion

java.lang.Object
com.codename1.backend.document.Criterion

public final class Criterion extends Object
One predicate of a document query: a field, an operator and its operand.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Equal; a null operand matches a null or missing field.
    static final int
    Greater than or equal.
    static final int
    Greater than.
    static final int
    One of an array of operands; an empty array matches nothing.
    static final int
    Less than or equal.
    static final int
    SQL LIKE: % is any run of characters and _ any one character.
    static final int
    Less than.
    static final int
    Not equal; a null operand matches any present, non-null field.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Criterion(String field, int op, Object value)
    A predicate; value is an Object[] for IN.
  • Method Summary

    Modifier and Type
    Method
    Description
    The document field.
    int
    One of the operator constants.
    The operand.
    static boolean
    like(String text, String pattern)
    Whether text matches a SQL LIKE pattern, case sensitive, without an escape character.
    boolean
    matches(Map doc)
    Whether doc satisfies this predicate, compared the way the stores do: numbers numerically, everything else by equals or natural order.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Criterion

      public Criterion(String field, int op, Object value)
      A predicate; value is an Object[] for IN.
  • Method Details

    • getField

      public String getField()
      The document field.
    • getOp

      public int getOp()
      One of the operator constants.
    • getValue

      public Object getValue()
      The operand.
    • like

      public static boolean like(String text, String pattern)
      Whether text matches a SQL LIKE pattern, case sensitive, without an escape character.
    • matches

      public boolean matches(Map doc)
      Whether doc satisfies this predicate, compared the way the stores do: numbers numerically, everything else by equals or natural order.