public class JsonSplittable extends Object implements Splittable, HasSplittable
NULL
Modifier and Type | Method and Description |
---|---|
boolean |
asBoolean()
Returns a boolean representation of the data.
|
double |
asNumber()
Returns a numeric representation of the data.
|
void |
assign(Splittable parent,
int index)
Assign the splittable to the specified index of the
parent object. |
void |
assign(Splittable parent,
String propertyName)
Assign the splittable to the named property of the
parent object. |
String |
asString()
Returns a string representation of the data.
|
static JsonSplittable |
create() |
static Splittable |
create(String payload) |
static Splittable |
createIndexed() |
static Splittable |
createNull() |
Splittable |
deepCopy()
Clones the Splittable, ignoring cycles and tags.
|
Splittable |
get(int index)
Returns the nth element of a list.
|
Splittable |
get(String key)
Returns the named property.
|
String |
getPayload()
Returns a wire-format representation of the data.
|
List<String> |
getPropertyKeys()
Returns all keys available in the Splittable.
|
Object |
getReified(String key)
Returns a value previously set with
Splittable.setReified(String, Object) . |
Splittable |
getSplittable() |
boolean |
isBoolean()
Returns
true if the value of the Splittable is a boolean. |
boolean |
isIndexed()
Returns
true if Splittable.size() and Splittable.get(int) can be
expected to return meaningful values. |
boolean |
isKeyed()
Returns
true if Splittable.getPropertyKeys() and Splittable.get(String)
can be expected to return meaningful values. |
boolean |
isNull(int index)
Indicates if the nth element of a list is null or undefined.
|
boolean |
isNull(String key)
Indicates if the named property is null or undefined.
|
boolean |
isNumber()
Returns
true if the value of the Splittable is numeric. |
boolean |
isReified(String key)
Returns
true if Splittable.setReified(String, Object) has been called
with the given key. |
boolean |
isString()
Returns
true if Splittable.asString() can be expected to return a
meaningful value. |
boolean |
isUndefined(String key)
Returns
true if the value of the key is undefined. |
void |
removeReified(String key)
Removes a tag value from the Splittable.
|
void |
setReified(String key,
Object object)
Associates a tag value with the Splittable.
|
void |
setSize(int size)
Resets the length of an indexed Splittable.
|
int |
size()
Returns the size of an indexed Splittable.
|
public static JsonSplittable create()
public static Splittable create(String payload)
public static Splittable createIndexed()
public static Splittable createNull()
public boolean asBoolean()
Splittable
asBoolean
in interface Splittable
public double asNumber()
Splittable
asNumber
in interface Splittable
public void assign(Splittable parent, int index)
Splittable
parent
object.assign
in interface Splittable
public void assign(Splittable parent, String propertyName)
Splittable
parent
object.assign
in interface Splittable
public String asString()
Splittable
asString
in interface Splittable
public Splittable deepCopy()
Splittable
deepCopy
in interface Splittable
public Splittable get(int index)
Splittable
get
in interface Splittable
public Splittable get(String key)
Splittable
get
in interface Splittable
public String getPayload()
Splittable
getPayload
in interface Splittable
public List<String> getPropertyKeys()
Splittable
getPropertyKeys
in interface Splittable
public Object getReified(String key)
Splittable
Splittable.setReified(String, Object)
.getReified
in interface Splittable
public Splittable getSplittable()
getSplittable
in interface HasSplittable
public boolean isBoolean()
Splittable
true
if the value of the Splittable is a boolean.isBoolean
in interface Splittable
public boolean isIndexed()
Splittable
true if Splittable.size()
and Splittable.get(int)
can be
expected to return meaningful values.isIndexed
in interface Splittable
public boolean isKeyed()
Splittable
true if Splittable.getPropertyKeys()
and Splittable.get(String)
can be expected to return meaningful values.isKeyed
in interface Splittable
public boolean isNull(int index)
Splittable
isNull
in interface Splittable
public boolean isNull(String key)
Splittable
isNull
in interface Splittable
public boolean isNumber()
Splittable
true
if the value of the Splittable is numeric.isNumber
in interface Splittable
public boolean isReified(String key)
Splittable
true
if Splittable.setReified(String, Object)
has been called
with the given key.isReified
in interface Splittable
public boolean isString()
Splittable
true if Splittable.asString()
can be expected to return a
meaningful value.isString
in interface Splittable
public boolean isUndefined(String key)
Splittable
true
if the value of the key is undefined.isUndefined
in interface Splittable
public void removeReified(String key)
Splittable
removeReified
in interface Splittable
key
- the key for the value to be removedpublic void setReified(String key, Object object)
Splittable
setReified
in interface Splittable
public void setSize(int size)
Splittable
setSize
in interface Splittable
public int size()
Splittable
size
in interface Splittable
Copyright © 2016. All rights reserved.