Interface Splittable
-
public interface SplittableThis 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 SplittableNULLA value that representsnull.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanasBoolean()Returns 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, java.lang.String propertyName)Assign the splittable to the named property of theparentobject.java.lang.StringasString()Returns a string representation of the data.SplittabledeepCopy()Clones the Splittable, ignoring cycles and tags.Splittableget(int index)Returns the nth element of a list.Splittableget(java.lang.String key)Returns the named property.java.lang.StringgetPayload()Returns a wire-format representation of the data.java.util.List<java.lang.String>getPropertyKeys()Returns all keys available in the Splittable.java.lang.ObjectgetReified(java.lang.String key)Returns a value previously set withsetReified(String, Object).booleanisBoolean()Returnstrueif the value of the Splittable is a boolean.booleanisIndexed()booleanisKeyed()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.booleanisNull(java.lang.String key)Indicates if the named property is null or undefined.booleanisNumber()Returnstrueif the value of the Splittable is numeric.booleanisReified(java.lang.String key)ReturnstrueifsetReified(String, Object)has been called with the given key.booleanisString()Returns true ifasString()can be expected to return a meaningful value.booleanisUndefined(java.lang.String key)Returnstrueif the value of the key is undefined.voidremoveReified(java.lang.String key)Removes a tag value from the Splittable.voidsetReified(java.lang.String key, java.lang.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 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 theparentobject.
-
assign
void assign(Splittable parent, java.lang.String propertyName)
Assign the splittable to the named property of theparentobject.
-
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()
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
boolean isNull(java.lang.String key)
Indicates if the named property is null or undefined.
-
isNumber
boolean isNumber()
Returnstrueif the value of the Splittable is numeric.
-
isReified
boolean isReified(java.lang.String key)
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
boolean isUndefined(java.lang.String key)
Returnstrueif 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.
-
-