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
ConstructorDescriptionTerminalClauseImpl
(String name, Operator operator, long operand) Creates a terminal clause with the specified name, operator and turns the long value into aSingleValueOperand
populated 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 aSingleValueOperand
populated with a string value.TerminalClauseImpl
(String name, Long... values) A convienience constructor that will create a clause with theOperator.EQUALS
operator if there is only one value in the array and with theOperator.IN
operator 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.EQUALS
operator if there is only one value in the array and with theOperator.IN
operator if there are more than one value in the array. -
Method Summary
Modifier and TypeMethodDescription<R> R
accept
(ClauseVisitor<R> visitor) Allows us to perform operations over the clauses based on the passed in visitor.boolean
getName()
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>
int
hashCode()
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 aSingleValueOperand
populated 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 aSingleValueOperand
populated 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.EQUALS
operator if there is only one value in the array and with theOperator.IN
operator 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.EQUALS
operator if there is only one value in the array and with theOperator.IN
operator 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:
getOperand
in 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:
getOperator
in interfaceTerminalClause
- Returns:
- the operator used by the clause
Operator
.
-
getProperty
- Specified by:
getProperty
in interfaceTerminalClause
- Returns:
- the name of the property or absent.
-
getName
Description copied from interface:Clause
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. -
getClauses
- Specified by:
getClauses
in interfaceClause
- Returns:
- child clauses if the clause has any, empty list if it has none.
-
accept
Description copied from interface:Clause
Allows 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:Clause
Return 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()
-