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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns a boolean representation of the data.doubleasNumber()Returns a numeric representation of the data.voidassign(Splittable parent, int index) Assign the splittable to the specified index of theparentobject.voidassign(Splittable parent, String propertyName) Assign the splittable to the named property of theparentobject.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).booleanReturnstrueif the value of the Splittable is a boolean.booleanbooleanisKeyed()Returns true ifgetPropertyKeys()andget(String)can be expected to return meaningful values.booleanisNull(int index) Indicates if the nth element of a list is null or undefined.booleanIndicates if the named property is null or undefined.booleanisNumber()Returnstrueif the value of the Splittable is numeric.booleanReturnstrueifsetReified(String, Object)has been called with the given key.booleanisString()Returns true ifasString()can be expected to return a meaningful value.booleanisUndefined(String key) Returnstrueif the value of the key is undefined.voidremoveReified(String key) Removes a tag value from the Splittable.voidsetReified(String key, Object object) Associates a tag value with the Splittable.voidsetSize(int i) Resets the length of an indexed Splittable.intsize()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()Returnstrueif 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()Returnstrueif the value of the Splittable is numeric. -
isReified
ReturnstrueifsetReified(String, Object)has been called with the given key. -
isString
boolean isString()Returns true ifasString()can be expected to return a meaningful value. -
isUndefined
Returnstrueif 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.
-