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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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, String propertyName) Assign the splittable to the named property of theparent
object.asString()
Returns a string representation of the data.deepCopy()
Clones the Splittable, ignoring cycles and tags.get
(int index) Returns the nth element of a list.Returns the named property.Returns a wire-format representation of the data.Returns all keys available in the Splittable.getReified
(String key) Returns a value previously set withsetReified(String, Object)
.boolean
Returnstrue
if the value of the Splittable is a boolean.boolean
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
Indicates if the named property is null or undefined.boolean
isNumber()
Returnstrue
if the value of the Splittable is numeric.boolean
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
(String key) Returnstrue
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 i) Resets the length of an indexed Splittable.int
size()
Returns the size of an indexed Splittable.
-
Field Details
-
NULL
A value that representsnull
.
-
-
Method Details
-
asBoolean
boolean asBoolean()Returns a boolean representation of the data. -
asNumber
double asNumber()Returns a numeric representation of the data. -
asString
String asString()Returns a string representation of the data. -
deepCopy
Splittable deepCopy()Clones the Splittable, ignoring cycles and tags. -
get
Returns the nth element of a list. -
get
Returns the named property. -
getPayload
String getPayload()Returns a wire-format representation of the data. -
getPropertyKeys
Returns all keys available in the Splittable. This method may be expensive to compute. -
getReified
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
Indicates if the named property is null or undefined. -
isNumber
boolean isNumber()Returnstrue
if the value of the Splittable is numeric. -
isReified
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
Returnstrue
if the value of the key is undefined. -
removeReified
Removes a tag value from the Splittable.- Parameters:
key
- the key for the value to be removed
-
setReified
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.
-