ComparatorNode
@ExperimentalAppSearchApi
public final class ComparatorNode implements Node
Node that represents a numeric search expression between a property and a numeric value.
All numeric search expressions are represented by this Node by passing in a Comparator that represent one of the comparator operators available in the query language, a PropertyPath representing the property, and a numeric value to compare the property against.
This node represents comparators as defined in the Google AIP EBNF Filtering Definition.
Summary
Constants |
|
|---|---|
static final int |
EQUALS = 0 |
static final int |
GREATER_EQUALS = 4 |
static final int |
GREATER_THAN = 3 |
static final int |
LESS_EQUALS = 2 |
static final int |
LESS_THAN = 1 |
Public constructors |
|---|
ComparatorNode(Construct a |
Public methods |
|
|---|---|
boolean |
|
int |
Get the |
@NonNull PropertyPath |
Get the |
long |
getValue()Get the numeric value being compared. |
int |
hashCode() |
void |
setComparator(int comparator)Set the |
void |
setPropertyPath(@NonNull PropertyPath propertyPath)Set the |
void |
setValue(long value)Set the numeric value being compared, i.e. the right side of the comparison. |
@NonNull String |
toString()Get the query string representation of |
Constants
Public constructors
ComparatorNode
public ComparatorNode(
int comparator,
@NonNull PropertyPath propertyPath,
long value
)
Construct a Node representing a numeric search expression between a property and a numeric value.
| Parameters | |
|---|---|
int comparator |
An |
@NonNull PropertyPath propertyPath |
A |
long value |
The numeric value being compared i.e. the right hand side of the comparison. |
Public methods
getPropertyPath
public @NonNull PropertyPath getPropertyPath()
Get the PropertyPath being compared.
I.e. left hand side of the comparison represented by this node.
getValue
public long getValue()
Get the numeric value being compared.
I.e. the right hand side of the comparison represented by this node.
setComparator
public void setComparator(int comparator)
Set the @Comparator being used to compare the PropertyPath and value.
setPropertyPath
public void setPropertyPath(@NonNull PropertyPath propertyPath)
Set the PropertyPath being compared, i.e. the left side of the comparison.
setValue
public void setValue(long value)
Set the numeric value being compared, i.e. the right side of the comparison.
toString
public @NonNull String toString()
Get the query string representation of ComparatorNode.
The string representation is the string representation of the property path joined from the left to the value being compared with the string representation of the Comparator.