public class


extends Object
   ↳ com.atlassian.jira.jql.operand.QueryLiteral

Class Overview

Used to communicate literal values, Strings or Longs, as input into the Operands.

  • Long values are typically used to represent ids or raw numerical values. For example, issue ids are represented using a Long.
  • String values are typically used to represent raw string values or named values that need to be resolved into ids. For example, issue keys or project names are represented using a String.

When writing JqlFunctions that must return QueryLiterals, try to return the more specific QueryLiteral where possible, to avoid unnecessary resolving. "More specific" here means the form that is used by the index (if applicable), as this value can then be used directly when constructing index queries.

QueryLiterals contain an operand source, this is the Operand of the JQL that produced the QueryLiteral. For instance in the JQL query project = HSP the "HSP" QueryLiteral will have the operand source of a SingleValueOperand with value "HSP". Notably QueryLiterals produced by JqlFunctions must set the FunctionOperand as the operand source.


Public Constructors
QueryLiteral(Operand sourceOperand)
QueryLiteral(Operand sourceOperand, Long longValue)
QueryLiteral(Operand sourceOperand, String stringValue)
Public Methods
String asString()
boolean equals(Object o)
Long getLongValue()
Operand getSourceOperand()
String getStringValue()
int hashCode()
boolean isEmpty()
String toString()
Inherited Methods
From class java.lang.Object

Public Constructors

public QueryLiteral ()

public QueryLiteral (Operand sourceOperand)

public QueryLiteral (Operand sourceOperand, Long longValue)

public QueryLiteral (Operand sourceOperand, String stringValue)

Public Methods

public String asString ()

public boolean equals (Object o)

public Long getLongValue ()

public Operand getSourceOperand ()

public String getStringValue ()

public int hashCode ()

public boolean isEmpty ()

public String toString ()