Class RawValue
- java.lang.Object
-
- com.google.appengine.api.datastore.RawValue
-
- All Implemented Interfaces:
Serializable
public final class RawValue extends Object implements 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 Description <T> @Nullable T
asStrictType(Class<T> type)
Returns an object of the exact type passed in.@Nullable Object
asType(Class<?> type)
Returns the object normally returned by the datastore if given type is passed in.boolean
equals(@Nullable Object obj)
@Nullable Object
getValue()
Returns the raw value.int
hashCode()
String
toString()
-
-
-
Method Detail
-
asStrictType
public <T> @Nullable T asStrictType(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:
IllegalArgumentException
- if the raw value cannot be converted into the given type
-
asType
public @Nullable Object asType(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:
IllegalArgumentException
- if the raw value cannot be converted into the given type
-
getValue
public @Nullable Object getValue()
Returns the raw value.
-
-