Package com.fauna.query.builder
Class QueryVal<T>
- java.lang.Object
-
- com.fauna.query.builder.QueryFragment<T>
-
- com.fauna.query.builder.QueryVal<T>
-
- Type Parameters:
T
- The type of the value in the fragment, which can be any object.
public final class QueryVal<T> extends QueryFragment<T>
Represents a value fragment of a Fauna query. This class encapsulates a value that can be a variable in the query, such as a literal value or a reference. The value can be any object type and will be substituted into the query at runtime.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Compares this QueryVal to another object for equality.T
get()
Retrieves the encapsulated value of this fragment.java.lang.Object
getValue()
Retrieves the value wrapped inside this fragment.int
hashCode()
Returns the hash code for this QueryVal.
-
-
-
Constructor Detail
-
QueryVal
public QueryVal(T value)
Constructs a QueryVal with the specified value.- Parameters:
value
- the value to encapsulate, which can be any object. It can represent a literal value or a reference to be used in the query.
-
-
Method Detail
-
get
public T get()
Retrieves the encapsulated value of this fragment.- Specified by:
get
in classQueryFragment<T>
- Returns:
- the value contained within this fragment.
-
equals
public boolean equals(java.lang.Object o)
Compares this QueryVal to another object for equality. Two QueryVal objects are considered equal if their encapsulated values are equal.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- the object to compare to.- Returns:
true
if this QueryVal is equal to the other object, otherwisefalse
.
-
hashCode
public int hashCode()
Returns the hash code for this QueryVal. The hash code is computed based on the encapsulated value.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hash code of this QueryVal.
-
getValue
public java.lang.Object getValue()
Retrieves the value wrapped inside this fragment.- Returns:
- the value contained in the QueryVal fragment.
-
-