Package com.atlassian.query.clause
Class TerminalClauseImpl
java.lang.Object
com.atlassian.query.clause.TerminalClauseImpl
- All Implemented Interfaces:
Clause,TerminalClause,Serializable
Used to represent a terminal node in the query tree.
- Since:
- v4.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTerminalClauseImpl(String name, Operator operator, long operand) Creates a terminal clause with the specified name, operator and turns the long value into aSingleValueOperandpopulated with a long value.TerminalClauseImpl(String name, Operator operator, Operand operand) Creates a terminal clause with the specified name, operator and operand.TerminalClauseImpl(String name, Operator operator, Operand operand, io.atlassian.fugue.Option<Property> property) Creates a terminal clause with the specified name, operator, operand and property.TerminalClauseImpl(String name, Operator operator, String operand) Creates a terminal clause with the specified name, operator and turns the string value into aSingleValueOperandpopulated with a string value.TerminalClauseImpl(String name, Long... values) A convienience constructor that will create a clause with theOperator.EQUALSoperator if there is only one value in the array and with theOperator.INoperator if there are more than one value in the array.TerminalClauseImpl(String name, String... values) A convienience constructor that will create a clause with theOperator.EQUALSoperator if there is only one value in the array and with theOperator.INoperator if there are more than one value in the array. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(ClauseVisitor<R> visitor) Allows us to perform operations over the clauses based on the passed in visitor.booleangetName()The name of the individual clause, this should be unique amongst the implementations otherwise the clauses will be treated as the "same" type of clause.io.atlassian.fugue.Option<Property>inthashCode()toString()Return a string representation of the clause.
-
Constructor Details
-
TerminalClauseImpl
Creates a terminal clause with the specified name, operator and turns the string value into aSingleValueOperandpopulated with a string value.- Parameters:
name- the name for the clause.operator- the operator for the clause.operand- the string value that will be wrapped in a SingleValueOperand.
-
TerminalClauseImpl
Creates a terminal clause with the specified name, operator and turns the long value into aSingleValueOperandpopulated with a long value.- Parameters:
name- the name for the clause.operator- the operator for the clause.operand- the long value that will be wrapped in a SingleValueOperand.
-
TerminalClauseImpl
Creates a terminal clause with the specified name, operator and operand.- Parameters:
name- the name for the clause.operator- the operator for the clause.operand- the right-hand-side value of the clause.
-
TerminalClauseImpl
public TerminalClauseImpl(String name, Operator operator, Operand operand, io.atlassian.fugue.Option<Property> property) Creates a terminal clause with the specified name, operator, operand and property.- Parameters:
name- the name for the clause.operator- the operator for the clause.operand- the right-hand-side value of the clause.property- the name of the property.
-
TerminalClauseImpl
A convienience constructor that will create a clause with theOperator.EQUALSoperator if there is only one value in the array and with theOperator.INoperator if there are more than one value in the array.- Parameters:
name- the name for the clause.values- the string values that will be turned intoSingleValueOperand's containing a string value.
-
TerminalClauseImpl
A convienience constructor that will create a clause with theOperator.EQUALSoperator if there is only one value in the array and with theOperator.INoperator if there are more than one value in the array.- Parameters:
name- the name for the clause.values- the long values that will be turned intoSingleValueOperand's containing a long value.
-
-
Method Details
-
getOperand
- Specified by:
getOperandin interfaceTerminalClause- Returns:
- the right hand side value of the expression. This can be a composite of more Operands or it can be SingleValueOperands that resolve to constant values.
-
getOperator
- Specified by:
getOperatorin interfaceTerminalClause- Returns:
- the operator used by the clause
Operator.
-
getProperty
- Specified by:
getPropertyin interfaceTerminalClause- Returns:
- the name of the property or absent.
-
getName
Description copied from interface:ClauseThe name of the individual clause, this should be unique amongst the implementations otherwise the clauses will be treated as the "same" type of clause. -
getClauses
- Specified by:
getClausesin interfaceClause- Returns:
- child clauses if the clause has any, empty list if it has none.
-
accept
Description copied from interface:ClauseAllows us to perform operations over the clauses based on the passed in visitor. This method calls the visit method on the visitor with this reference. -
toString
Description copied from interface:ClauseReturn a string representation of the clause. This string representation should not be used to represent the clause to the user as it may not be valid. For example, this method makes no attempt to escape invalid names and strings. -
equals
-
hashCode
public int hashCode()
-