Class Operator

java.lang.Object
com.jk.data.dynamic.query.Operator
All Implemented Interfaces:
QueryComponent

public class Operator extends Object implements QueryComponent
This class represents a query component that defines common operators used in query conditions.

It implements the QueryComponent interface.

Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Operator
    Represents the comma operator.
    static final Operator
    Represents the equal operator.
    static final Operator
    Represents the less than operator.
    static final Operator
    Represents the more than operator.
  • Constructor Summary

    Constructors
    Constructor
    Description
    This method constructs a new Operator.
  • Method Summary

    Modifier and Type
    Method
    Description
    This method get the operator name.
    boolean
    This method determines whether the query component should be rendered in-line in the query structure (true) or not (false).
    void
    This method sets the operator name to the provided value.
    This method converts the query component into a query element that can be included in the query structure.
    Returns a string representation of the object

    Methods inherited from class java.lang.Object

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

    • EQUAL

      public static final Operator EQUAL
      Represents the equal operator.
    • COMMA

      public static final Operator COMMA
      Represents the comma operator.
    • MORE_THAN

      public static final Operator MORE_THAN
      Represents the more than operator.
    • LESS_THAN

      public static final Operator LESS_THAN
      Represents the less than operator.
  • Constructor Details

    • Operator

      public Operator(String name)
      This method constructs a new Operator.
      Parameters:
      name - the name
  • Method Details

    • getName

      public String getName()
      This method get the operator name.
      Returns:
      the operator name.
    • isInline

      public boolean isInline()
      This method determines whether the query component should be rendered in-line in the query structure (true) or not (false).
      Specified by:
      isInline in interface QueryComponent
      Returns:
      true.
    • setName

      public void setName(String name)
      This method sets the operator name to the provided value.
      Parameters:
      name - Specifies the new operator name.
    • toQueryElement

      public Object toQueryElement()
      This method converts the query component into a query element that can be included in the query structure.
      Specified by:
      toQueryElement in interface QueryComponent
      Returns:
      the query element, which can be a string or any appropriate object representation.
    • toString

      public String toString()
      Returns a string representation of the object
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.