Package org.intermine.objectstore.query
Class QueryValue
- java.lang.Object
-
- org.intermine.objectstore.query.QueryValue
-
- All Implemented Interfaces:
QueryEvaluable
,QueryNode
,QueryOrderable
,QuerySelectable
public class QueryValue extends java.lang.Object implements QueryEvaluable
Represents a constant in a Query- Author:
- Mark Woodbridge, Richard Smith, Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description static QueryValue
FALSE
The false valuestatic QueryValue
TRUE
The true value
-
Constructor Summary
Constructors Constructor Description QueryValue(java.lang.Object value)
Construct a QueryValue
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Overrides Object.int
getApproximateType()
Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.java.lang.Class<?>
getType()
Get Java type represented by this item.java.lang.Object
getValue()
Returns the object that is the actual value.int
hashCode()
Overrides Object.java.lang.String
toString()
void
youAreType(java.lang.Class<?> cls)
Allows a caller to suggest to this object that it holds a value of a certain type.
-
-
-
Field Detail
-
TRUE
public static final QueryValue TRUE
The true value
-
FALSE
public static final QueryValue FALSE
The false value
-
-
Method Detail
-
getType
public java.lang.Class<?> getType()
Get Java type represented by this item.- Specified by:
getType
in interfaceQueryOrderable
- Specified by:
getType
in interfaceQuerySelectable
- Returns:
- class describing the type
-
getValue
public java.lang.Object getValue()
Returns the object that is the actual value.- Returns:
- the value
-
equals
public boolean equals(java.lang.Object obj)
Overrides Object.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- object to compare to- Returns:
- true if obj is a QueryValue with the same encapsulated object
-
hashCode
public int hashCode()
Overrides Object.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- an integer based on the contents of this object
-
youAreType
public void youAreType(java.lang.Class<?> cls)
Allows a caller to suggest to this object that it holds a value of a certain type. This method should only be called on objects which report their type to be UnknownTypeValue. Otherwise, this method will throw and exception.- Specified by:
youAreType
in interfaceQueryEvaluable
- Parameters:
cls
- the Class of the type to be imposed on this object
-
getApproximateType
public int getApproximateType()
Returns an integer representing the approximate type of this QueryEvaluable, in the case where an accurate type cannot be ascertained.- Specified by:
getApproximateType
in interfaceQueryEvaluable
- Returns:
- an int, as described in UnknownTypeValue
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-