public class FieldValue extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
FieldValue.Attribute
The field value's attribute, giving information on the field's content type.
|
Modifier and Type | Method and Description |
---|---|
FieldValue.Attribute |
attribute()
Deprecated.
|
boolean |
booleanValue()
Deprecated.
|
byte[] |
bytesValue()
Deprecated.
|
double |
doubleValue()
Deprecated.
|
boolean |
equals(Object obj) |
FieldValue.Attribute |
getAttribute()
Returns the attribute of this Field Value.
|
boolean |
getBooleanValue()
Returns this field's value as a
Boolean . |
byte[] |
getBytesValue()
Returns this field's value as a byte array.
|
double |
getDoubleValue()
Returns this field's value as a
Double . |
long |
getLongValue()
Returns this field's value as a
long . |
List<FieldValue> |
getRecordValue()
Returns this field's value as a list of
FieldValue . |
List<FieldValue> |
getRepeatedValue()
Returns this field's value as a list of
FieldValue . |
String |
getStringValue()
Returns this field's value as a
String . |
long |
getTimestampValue()
Returns this field's value as a
long , representing a timestamp in microseconds since
epoch (UNIX time). |
Object |
getValue()
Returns this field's value as an
Object . |
int |
hashCode() |
boolean |
isNull()
Returns
true if this field's value is null , false otherwise. |
long |
longValue()
Deprecated.
|
List<FieldValue> |
recordValue()
Deprecated.
|
List<FieldValue> |
repeatedValue()
Deprecated.
|
String |
stringValue()
Deprecated.
|
long |
timestampValue()
Deprecated.
|
String |
toString() |
Object |
value()
Deprecated.
|
@Deprecated public FieldValue.Attribute attribute()
FieldValue.Attribute.PRIMITIVE
if the field is a primitive type
(Field.Type.bytes()
, Field.Type.bool()
, Field.Type.string()
,
Field.Type.floatingPoint()
, Field.Type.integer()
,
Field.Type.timestamp()
) or is null
. Returns FieldValue.Attribute.REPEATED
if
the corresponding field has (Field.Mode.REPEATED
) mode. Returns
FieldValue.Attribute.RECORD
if the corresponding field is a
Field.Type.record(Field...)
type.public FieldValue.Attribute getAttribute()
FieldValue.Attribute.PRIMITIVE
if the field is a primitive type
(Field.Type.bytes()
, Field.Type.bool()
, Field.Type.string()
,
Field.Type.floatingPoint()
, Field.Type.integer()
,
Field.Type.timestamp()
) or is null
. Returns FieldValue.Attribute.REPEATED
if
the corresponding field has (Field.Mode.REPEATED
) mode. Returns
FieldValue.Attribute.RECORD
if the corresponding field is a
Field.Type.record(Field...)
type.public boolean isNull()
true
if this field's value is null
, false
otherwise.@Deprecated public Object value()
public Object getValue()
@Deprecated public String stringValue()
String
. This method should only be used if the
corresponding field has primitive type (Field.Type.bytes()
, Field.Type.bool()
,
Field.Type.string()
, Field.Type.floatingPoint()
, Field.Type.integer()
,
Field.Type.timestamp()
).ClassCastException
- if the field is not a primitive typeNullPointerException
- if isNull()
returns true
public String getStringValue()
String
. This method should only be used if the
corresponding field has primitive type (Field.Type.bytes()
, Field.Type.bool()
,
Field.Type.string()
, Field.Type.floatingPoint()
, Field.Type.integer()
,
Field.Type.timestamp()
).ClassCastException
- if the field is not a primitive typeNullPointerException
- if isNull()
returns true
@Deprecated public byte[] bytesValue()
Field.Type.bytes()
.ClassCastException
- if the field is not a primitive typeNullPointerException
- if isNull()
returns true
IllegalStateException
- if the field value is not encoded in base64public byte[] getBytesValue()
Field.Type.bytes()
.ClassCastException
- if the field is not a primitive typeNullPointerException
- if isNull()
returns true
IllegalStateException
- if the field value is not encoded in base64@Deprecated public long longValue()
long
. This method should only be used if the
corresponding field has Field.Type.integer()
type.ClassCastException
- if the field is not a primitive typeNumberFormatException
- if the field's value could not be converted to Integer
NullPointerException
- if isNull()
returns true
public long getLongValue()
long
. This method should only be used if the
corresponding field has Field.Type.integer()
type.ClassCastException
- if the field is not a primitive typeNumberFormatException
- if the field's value could not be converted to Integer
NullPointerException
- if isNull()
returns true
@Deprecated public double doubleValue()
Double
. This method should only be used if the
corresponding field has Field.Type.floatingPoint()
type.ClassCastException
- if the field is not a primitive typeNumberFormatException
- if the field's value could not be converted to Double
NullPointerException
- if isNull()
returns true
public double getDoubleValue()
Double
. This method should only be used if the
corresponding field has Field.Type.floatingPoint()
type.ClassCastException
- if the field is not a primitive typeNumberFormatException
- if the field's value could not be converted to Double
NullPointerException
- if isNull()
returns true
@Deprecated public boolean booleanValue()
Boolean
. This method should only be used if the
corresponding field has Field.Type.bool()
type.ClassCastException
- if the field is not a primitive typeIllegalStateException
- if the field's value could not be converted to Boolean
NullPointerException
- if isNull()
returns true
public boolean getBooleanValue()
Boolean
. This method should only be used if the
corresponding field has Field.Type.bool()
type.ClassCastException
- if the field is not a primitive typeIllegalStateException
- if the field's value could not be converted to Boolean
NullPointerException
- if isNull()
returns true
@Deprecated public long timestampValue()
long
, representing a timestamp in microseconds since
epoch (UNIX time). This method should only be used if the corresponding field has
Field.Type.timestamp()
type.ClassCastException
- if the field is not a primitive typeNumberFormatException
- if the field's value could not be converted to Long
NullPointerException
- if isNull()
returns true
public long getTimestampValue()
long
, representing a timestamp in microseconds since
epoch (UNIX time). This method should only be used if the corresponding field has
Field.Type.timestamp()
type.ClassCastException
- if the field is not a primitive typeNumberFormatException
- if the field's value could not be converted to Long
NullPointerException
- if isNull()
returns true
@Deprecated public List<FieldValue> repeatedValue()
FieldValue
. This method should only be used if
the corresponding field has Field.Mode.REPEATED
mode (i.e. attribute()
is
FieldValue.Attribute.REPEATED
).ClassCastException
- if the field has not Field.Mode.REPEATED
modeNullPointerException
- if isNull()
returns true
public List<FieldValue> getRepeatedValue()
FieldValue
. This method should only be used if
the corresponding field has Field.Mode.REPEATED
mode (i.e. attribute()
is
FieldValue.Attribute.REPEATED
).ClassCastException
- if the field has not Field.Mode.REPEATED
modeNullPointerException
- if isNull()
returns true
@Deprecated public List<FieldValue> recordValue()
FieldValue
. This method should only be used if
the corresponding field has Field.Type.record(Field...)
type (i.e. attribute()
is FieldValue.Attribute.RECORD
).ClassCastException
- if the field is not a Field.Type.record(Field...)
typeNullPointerException
- if isNull()
returns true
public List<FieldValue> getRecordValue()
FieldValue
. This method should only be used if
the corresponding field has Field.Type.record(Field...)
type (i.e. attribute()
is FieldValue.Attribute.RECORD
).ClassCastException
- if the field is not a Field.Type.record(Field...)
typeNullPointerException
- if isNull()
returns true
Copyright © 2016 Google. All rights reserved.