Interface Splittable
-
public interface Splittable
This interface provides an abstraction around the underlying data model (JavaScriptObject, or JSON) used to encode an AutoBeanCodex payload.
-
-
Field Summary
Fields Modifier and Type Field Description static Splittable
NULL
A value that representsnull
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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 theparent
object.void
assign(Splittable parent, java.lang.String propertyName)
Assign the splittable to the named property of theparent
object.java.lang.String
asString()
Returns a string representation of the data.Splittable
deepCopy()
Clones the Splittable, ignoring cycles and tags.Splittable
get(int index)
Returns the nth element of a list.Splittable
get(java.lang.String key)
Returns the named property.java.lang.String
getPayload()
Returns a wire-format representation of the data.java.util.List<java.lang.String>
getPropertyKeys()
Returns all keys available in the Splittable.java.lang.Object
getReified(java.lang.String key)
Returns a value previously set withsetReified(String, Object)
.boolean
isBoolean()
Returnstrue
if the value of the Splittable is a boolean.boolean
isIndexed()
boolean
isKeyed()
Returns true ifgetPropertyKeys()
andget(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(java.lang.String key)
Indicates if the named property is null or undefined.boolean
isNumber()
Returnstrue
if the value of the Splittable is numeric.boolean
isReified(java.lang.String key)
Returnstrue
ifsetReified(String, Object)
has been called with the given key.boolean
isString()
Returns true ifasString()
can be expected to return a meaningful value.boolean
isUndefined(java.lang.String key)
Returnstrue
if the value of the key is undefined.void
removeReified(java.lang.String key)
Removes a tag value from the Splittable.void
setReified(java.lang.String key, java.lang.Object object)
Associates a tag value with the Splittable.void
setSize(int i)
Resets the length of an indexed Splittable.int
size()
Returns the size of an indexed Splittable.
-
-
-
Field Detail
-
NULL
static final Splittable NULL
A value that representsnull
.
-
-
Method Detail
-
asBoolean
boolean asBoolean()
Returns a boolean representation of the data.
-
asNumber
double asNumber()
Returns a numeric representation of the data.
-
assign
void assign(Splittable parent, int index)
Assign the splittable to the specified index of theparent
object.
-
assign
void assign(Splittable parent, java.lang.String propertyName)
Assign the splittable to the named property of theparent
object.
-
asString
java.lang.String asString()
Returns a string representation of the data.
-
deepCopy
Splittable deepCopy()
Clones the Splittable, ignoring cycles and tags.
-
get
Splittable get(int index)
Returns the nth element of a list.
-
get
Splittable get(java.lang.String key)
Returns the named property.
-
getPayload
java.lang.String getPayload()
Returns a wire-format representation of the data.
-
getPropertyKeys
java.util.List<java.lang.String> getPropertyKeys()
Returns all keys available in the Splittable. This method may be expensive to compute.
-
getReified
java.lang.Object getReified(java.lang.String key)
Returns a value previously set withsetReified(String, Object)
.
-
isBoolean
boolean isBoolean()
Returnstrue
if the value of the Splittable is a boolean.
-
isIndexed
boolean isIndexed()
-
isKeyed
boolean isKeyed()
Returns true ifgetPropertyKeys()
andget(String)
can be expected to return meaningful values.
-
isNull
boolean isNull(int index)
Indicates if the nth element of a list is null or undefined.
-
isNull
boolean isNull(java.lang.String key)
Indicates if the named property is null or undefined.
-
isNumber
boolean isNumber()
Returnstrue
if the value of the Splittable is numeric.
-
isReified
boolean isReified(java.lang.String key)
Returnstrue
ifsetReified(String, Object)
has been called with the given key.
-
isString
boolean isString()
Returns true ifasString()
can be expected to return a meaningful value.
-
isUndefined
boolean isUndefined(java.lang.String key)
Returnstrue
if the value of the key is undefined.
-
removeReified
void removeReified(java.lang.String key)
Removes a tag value from the Splittable.- Parameters:
key
- the key for the value to be removed
-
setReified
void setReified(java.lang.String key, java.lang.Object object)
Associates a tag value with the Splittable.
-
setSize
void setSize(int i)
Resets the length of an indexed Splittable.
-
size
int size()
Returns the size of an indexed Splittable.
-
-