com.google.appengine.api.datastore
Class RawValue
- java.lang.Object
-
- com.google.appengine.api.datastore.RawValue
-
- All Implemented Interfaces:
- java.io.Serializable
public final class RawValue extends java.lang.Object implements java.io.Serializable
A raw datastore value.These are returned by projection queries when a
PropertyProjection
does not specify a type.- See Also:
Query.getProjections()
, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description <T> T
asStrictType(java.lang.Class<T> type)
Returns an object of the exact type passed in.java.lang.Object
asType(java.lang.Class<?> type)
Returns the object normally returned by the datastore if given type is passed in.boolean
equals(java.lang.Object obj)
java.lang.Object
getValue()
Returns the raw value.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
asStrictType
public <T> T asStrictType(java.lang.Class<T> type)
Returns an object of the exact type passed in.- Parameters:
type
- the class object for the desired type- Returns:
- an object of type T or
null
- Throws:
java.lang.IllegalArgumentException
- if the raw value cannot be converted into the given type
-
asType
public java.lang.Object asType(java.lang.Class<?> type)
Returns the object normally returned by the datastore if given type is passed in.All integer values are returned as
Long
. All floating point values are returned asDouble
.- Parameters:
type
- the class object for the desired type- Returns:
- an object of type T or
null
- Throws:
java.lang.IllegalArgumentException
- if the raw value cannot be converted into the given type
-
getValue
public java.lang.Object getValue()
Returns the raw value.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-