Class SingleValueOperand

java.lang.Object
com.atlassian.query.operand.SingleValueOperand
All Implemented Interfaces:
Operand, Serializable

public final class SingleValueOperand extends Object implements Operand
Used to represent a single constant value as an Operand.
Since:
v4.0
See Also:
  • Field Details

  • Constructor Details

    • SingleValueOperand

      public SingleValueOperand(String stringValue)
    • SingleValueOperand

      public SingleValueOperand(Long longValue)
    • SingleValueOperand

      public SingleValueOperand(QueryLiteral literal)
      Note: cannot accept an empty QueryLiteral. Use EmptyOperand instead.
      Parameters:
      literal - the query literal to convert to an operand; must not be null or empty.
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Operand
      The name that represents this Operand.
      Specified by:
      getName in interface Operand
      Returns:
      the name of the operand, null if the operand is unnamed. If an operand is unnamed then it likely represents literal values (such as Strings or Longs).
    • getDisplayString

      public String getDisplayString()
      Description copied from interface: Operand
      Produces the unexpanded representation of the Operand. In the case of a function operand this would be the function as represented in the Query (i.e. group(jira-users)).
      Specified by:
      getDisplayString in interface Operand
      Returns:
      a string that represents this operand as represented in the JQL query string.
    • accept

      public <R> R accept(OperandVisitor<R> visitor)
      Description copied from interface: Operand
      Allows us to perform operations over the operand based on the passed in visitor. This method calls the visit method on the visitor with this reference.
      Specified by:
      accept in interface Operand
      Type Parameters:
      R - the return type for the visitor.
      Parameters:
      visitor - the visitor to accept.
      Returns:
      the result of the visit operation who's type is specified by the incomming visitor.
    • getLongValue

      public Long getLongValue()
    • getStringValue

      public String getStringValue()
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object