public class UniversalContainer extends Object implements Iterable<UniversalContainer>
All public methods in this class try to replicate behaviour of JS variables as much as possible, however there can be some differences, but API is quite close to JS. Full list of all implemented javascript methods and properties (fully, partially or differently):
Also this class has shortcuts to some popular methods from Lodash library, see Lodash class.
| Container | Java raw class |
|---|---|
| UNDEFINED | null (any class) |
| NULL | |
| BOOLEAN LITERAL | boolean, Boolean |
| NUMBER LITERAL | int, float, double, Integer, Float, Double |
| STRING LITERAL | String |
| OTHER LITERAL | any other class except listed in this table |
| OBJECT | Map (and any other class inherited from it) |
| ARRAY | Java arrays, List (and any other class inherited from it), Set (and any other class inherited
from it) |
| Constructor and Description |
|---|
UniversalContainer(Iterable<Object> list)
Constructor, which will produce ARRAY container with the values based on the specified Iterable object.
|
UniversalContainer(Map<Object,Object> map)
Constructor, which will produce OBJECT container with the values based on the specified Map.
|
UniversalContainer(Object value)
Constructor, which will produce simple LITERAL container with the specified value.
|
UniversalContainer(Object[] array)
Constructor, which will produce ARRAY container with the values based on the specified array.
|
UniversalContainer(UniversalContainer container)
Constructor, which will produce very shallow copy of the specified container.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
asBoolean()
Converts current value to a boolean value.
|
boolean |
asBoolean(int index)
Converts value, which is located in the specified position to a boolean value.
|
boolean |
asBoolean(String property)
Converts value, which is located in the specified property to a boolean value.
|
double |
asDouble()
Converts current value to a double value.
|
double |
asDouble(int index)
Converts value, which is located in the specified position to a double value.
|
double |
asDouble(String property)
Converts value, which is located in the specified property to a double value.
|
int |
asInt()
Converts current value to an integer value.
|
int |
asInt(int index)
Converts value, which is located in the specified position to an integer value.
|
int |
asInt(String property)
Converts value, which is located in the specified property to an integer value.
|
<T> List<T> |
asList(Class<T> clazz)
Converts current ARRAY container to List.
|
<T> Map<String,T> |
asMap(Class<T> clazz)
Converts current OBJECT container to Map.
|
String |
asString()
Converts current value to a string value.
|
String |
asString(int index)
Converts value, which is located in the specified position to a string value.
|
String |
asString(String property)
Converts value, which is located in the specified property to a string value.
|
UniversalContainer |
clone()
A shortcut to the
Lodash.clone(UniversalContainer) method. |
UniversalContainer |
concat(Object... sources)
This method has two different algorithms depending on the current container type:
|
UniversalContainer |
create()
Creates new OBJECT container, with the current container as a prototype.
|
boolean |
deepEquals(Object other)
A shortcut to the
Lodash.isEqual(UniversalContainer, Object) method. |
void |
delete(int index)
Removes an index from the current container.
|
void |
delete(String property)
Removes a property from the current container.
|
boolean |
equals(Object other)
Compares current container and passed value and returns true if they equal.
|
UniversalContainer |
extend(UniversalContainer... sources)
A shortcut to the
Lodash.extend(UniversalContainer, UniversalContainer...) method. |
UniversalContainer |
get(int index)
Reads a value from the current container located at specified index.
|
UniversalContainer |
get(String property)
Reads specified property from the current container.
|
ContainerConstructor |
getConstructor()
Reads built-in "constructor" property.
|
Integer |
getLength()
Reads built-in "length" property.
|
Integer |
getLength(Integer defaultLength)
Reads built-in "length" property.
|
UniversalContainer |
getProto()
Returns current container's prototype.
|
boolean |
has(int index)
Checks if specified index exists in the current container.
|
boolean |
has(int index,
boolean own)
Checks if specified index exists in the current container.
|
boolean |
has(String property)
Checks if specified property exists in the current container.
|
boolean |
has(String property,
boolean own)
Checks if specified property exists in the current container.
|
int |
indexOf(Object value)
This method has two different algorithms depending on the current container type:
|
boolean |
isArray()
Checks if current container is ARRAY container.
|
boolean |
isArray(int index)
Checks if value at specified position is ARRAY container.
|
boolean |
isArray(String property)
Checks if value in specified property is ARRAY container.
|
boolean |
isBoolean()
Checks if current container is BOOLEAN LITERAL container.
|
boolean |
isBoolean(int index)
Checks if value at specified position is BOOLEAN LITERAL container.
|
boolean |
isBoolean(String property)
Checks if value in specified property is BOOLEAN LITERAL container.
|
boolean |
isNull()
Checks if current container is NULL container.
|
boolean |
isNull(int index)
Checks if value at specified position is NULL container.
|
boolean |
isNull(String property)
Checks if value in specified property is NULL container.
|
boolean |
isNumber()
Checks if current container is NUMBER LITERAL container.
|
boolean |
isNumber(int index)
Checks if value at specified position is NUMBER LITERAL container.
|
boolean |
isNumber(String property)
Checks if value in specified property is NUMBER LITERAL container.
|
boolean |
isObject()
Checks if current container is OBJECT container.
|
boolean |
isObject(int index)
Checks if value at specified position is OBJECT, ARRAY or NULL container.
|
boolean |
isObject(String property)
Checks if value in specified property is OBJECT, ARRAY or NULL container.
|
boolean |
isString()
Checks if current container is STRING LITERAL container.
|
boolean |
isString(int index)
Checks if value at specified position is STRING LITERAL container.
|
boolean |
isString(String property)
Checks if value in specified property is STRING LITERAL container.
|
boolean |
isUndefined()
Checks if current container is UNDEFINED container.
|
boolean |
isUndefined(int index)
Checks if value at specified position is UNDEFINED container.
|
boolean |
isUndefined(String property)
Checks if value in specified property is UNDEFINED container.
|
Iterator<UniversalContainer> |
iterator()
Creates iterator over current container values (if it's ARRAY or STRING) or keys (if OBJECT), which can be in for
statement.
|
Set<String> |
keys()
Returns a set of all own indexes/properties of the current container.
|
Set<String> |
keys(boolean own)
Returns a set of all indexes/properties of the current container.
|
UniversalContainer |
last()
A shortcut to the
Lodash.last(UniversalContainer) method. |
UniversalContainer |
merge(UniversalContainer... sources)
A shortcut to the
Lodash.merge(UniversalContainer, UniversalContainer...) method. |
UniversalContainer |
pop()
Removes the last value from the current container and returns removed value.
|
int |
push(Object... values)
Adds one or more values to the end of the current ARRAY container and returns new length.
|
UniversalContainer |
set(int index,
Object value)
Writes value in the current container under specified index.
|
UniversalContainer |
set(String property,
Object value)
Writes value in the current container under specified property.
|
void |
setLength(int newLength)
Overrides built-in "length" property.
|
UniversalContainer |
shift()
Removes the element at the zeroeth index and shifts the values at consecutive indexes down, then returns the
removed value.
|
UniversalContainer |
splice(int start,
int deleteCount)
Changes the content of th current ARRAY container by removing existing elements using start and
deleteCount parameters.
|
boolean |
test()
Checks if current container can be resolved to true in "if" conditions.
|
boolean |
test(int index)
Checks if value at specified position can be resolved to true in "if" conditions.
|
boolean |
test(String property)
Checks if value in specified property can be resolved to true in "if" conditions.
|
String |
toString()
Returns a string representation of the current container.
|
<T> T |
valueOf()
Simply extracts value from the current container.
|
<T> T |
valueOf(int index)
Simply extracts value from the specified position in the current container.
|
<T> T |
valueOf(String property)
Simply extracts value from the specified property in the current container.
|
UniversalContainer |
values()
A shortcut to the
Lodash.values(UniversalContainer) method. |
getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic UniversalContainer(Object value)
value - value, which will be stored in the LITERAL container.public UniversalContainer(UniversalContainer container)
container - container, which will be copied.public UniversalContainer(Object[] array)
array - java array, which will be used as source for new ARRAY container.public UniversalContainer(Iterable<Object> list)
list - any Iterable object, which will be used as source for new ARRAY container.public boolean asBoolean()
public boolean asBoolean(int index)
get(index).asBoolean();index - position of value, which will be converted to boolean.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.asBoolean()public boolean asBoolean(String property)
get(property).asBoolean();property - name of the property, which value will be converted to boolean.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.asBoolean()public double asDouble()
public double asDouble(int index)
get(index).asDouble();index - position of value, which will be converted to double.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.asDouble()public double asDouble(String property)
get(property).asDouble();property - name of the property, which value will be converted to double.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.asDouble()public int asInt()
public int asInt(int index)
get(index).asInt();index - position of value, which will be converted to integer.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.asInt()public int asInt(String property)
get(property).asInt();property - name of the property, which value will be converted to integer.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.asInt()public String asString()
toString()public String asString(int index)
get(index).asString();index - position of value, which will be converted to string.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.asString()public String asString(String property)
get(property).asString();property - name of the property, which value will be converted to string.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.asString()public <T> List<T> asList(Class<T> clazz)
T - the type of the List elementclazz - class, which will as a type for a resulting List.ClassCastException - if one of the values cannot be casted to a desired class.public <T> Map<String,T> asMap(Class<T> clazz)
T - the type of the Map elementclazz - class, which will be used as a type for a resulting Map.ClassCastException - if one of the values cannot be casted to a desired class.public <T> T valueOf()
T - the type of the value stored in the containerClassCastException - if value cannot be casted to a desired class.public <T> T valueOf(int index)
get(index).valueOf();T - the type of the value stored in the containerindex - position of value, which will be extracted.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.ClassCastException - if value cannot be casted to a desired class.valueOf()public <T> T valueOf(String property)
get(property).valueOf();T - the type of the value stored in the containerproperty - name of the property, which value will be extracted.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.ClassCastException - if value cannot be casted to a desired class.valueOf()public boolean isArray()
Javascript Note: can be used as a replacement of static javascript method Array. isArray(obj).
public boolean isArray(int index)
get(index).isArray();index - position of value, which will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.isArray()public boolean isArray(String property)
get(property).isArray();property - name of the property, which value will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.isArray()public boolean isBoolean()
Javascript Note: can be used as a replacement of expression
typeof obj === "boolean"public boolean isBoolean(int index)
get(index).isBoolean();index - position of value, which will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.isBoolean()public boolean isBoolean(String property)
get(property).isBoolean();property - name of the property, which value will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.isBoolean()public boolean isObject()
Javascript Note: can be used as a replacement of expression
typeof obj === "object"public boolean isObject(int index)
get(index).isObject();index - position of value, which will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.isObject()public boolean isObject(String property)
get(property).isObject();property - name of the property, which value will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.isObject()public boolean isNull()
Javascript Note: can be used as a replacement of expression
obj === nullpublic boolean isNull(int index)
get(index).isNull();index - position of value, which will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.isNull()public boolean isNull(String property)
get(property).isNull();property - name of the property, which value will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.isNull()public boolean isNumber()
Javascript Note: can be used as a replacement of expression
typeof obj === "number"public boolean isNumber(int index)
get(index).isNumber();index - position of value, which will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.isNumber()public boolean isNumber(String property)
get(property).isNumber();property - name of the property, which value will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.isNumber()public boolean isString()
Javascript Note: can be used as a replacement of expression
typeof obj === "string"public boolean isString(int index)
get(index).isString();index - position of value, which will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.isString()public boolean isString(String property)
get(property).isString();property - name of the property, which value will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.isString()public boolean isUndefined()
Javascript Note: can be used as a replacement of expression
obj === undefinedpublic boolean isUndefined(int index)
get(index).isUndefined();index - position of value, which will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.isUndefined()public boolean isUndefined(String property)
get(property).isUndefined();property - name of the property, which value will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.isUndefined()public boolean test()
Javascript Note: this method is a general way to emulate values checking in "if" conditions in JS. For example following expression:
if (obj) { ... } can be replaced with
something like this: if (obj.test()) { ... }public boolean test(int index)
get(index).test();index - position of value, which will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.test()public boolean test(String property)
get(property).test();
but it will work differently for built-in properties like "constructor" and "length" - it will check if
getConstructor() returns null and if getLength(Integer) returns 0 accordingly.
property - name of the property, which will be tested.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.test()public UniversalContainer get(int index)
ContainerException.
Note: this method will first scan current container for an index and if nothing will be found it will scan prototype.
Javascript Note: this method is a general way to access values by index, it emulates square brackets in JS. For example following expression:
value = obj[index]; can be replaced
with something like this: value = obj.get(index);index - position in the current container, which will be read.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.public UniversalContainer get(String property)
ContainerException.
Note: this method will first scan current container for a property and if nothing will be found it will scan prototype.
Javascript Note: this method is a general way to access property, it emulates square brackets and dot notation in JS. For example following expressions:
value = obj[property];
value = obj.property; can be replaced with something like this:
value = obj.get(property);property - name of the property in the current container, which will be read.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.public ContainerConstructor getConstructor()
ContainerException.
Note: this method will first search current container for a constructor property and if nothing will be found it will search in prototype and so on.
Warning: do not use this method, because it's not finalized yet, currently it's only used in
Lodash.isEqual(UniversalContainer, Object) method.
ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
constructor.public Integer getLength()
getLength(Integer) instead. If current container is UNDEFINED or
NULL, method will throw ContainerException.
Note: this method will first search current container for a length property and if nothing will be found it will search in prototype and so on.
ContainerException - if current container is UNDEFINED or NULL, since these containers can't have length.getLength(Integer)public Integer getLength(Integer defaultLength)
ContainerException.
Note: this method will first search current container for a length property and if nothing will be found it will search in prototype and so on.
defaultLength - the value, which will be returned if length doesn't exists.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have length.public UniversalContainer getProto()
public UniversalContainer set(int index, Object value)
ContainerException.
Javascript Note: this method is a general way to write values at specified index, it emulates square brackets in JS. For example following expression:
obj[index] = value; can
be replaced with something like this: obj.set(index, value);index - position in the current container, where object will be stored.value - object, which will be stored in the current container under specified position.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have indexes.public UniversalContainer set(String property, Object value)
ContainerException.
Javascript Note: this method is a general way to write value under specified property, it emulates square brackets and dot notation in JS. For example following expressions:
obj[property] = value; obj.property = value; can
be replaced with something like this: obj.set(property, value);property - name of the property, under which value will be stored.value - object, which will be stored in the current container.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have
properties.public void setLength(int newLength)
ContainerException. The same exception will be thrown if current container is UNDEFINED or NULL.newLength - non-negative integer value, which will override current length.ContainerException - if current container is UNDEFINED or NULL, since these containers can't have length.public UniversalContainer concat(Object... sources)
1) If current container is a STRING LITERAL, then this method will convert all sources to a string and will produce new STRING LITERAL container consisted of all strings appended one by one. This is a precise implementation of JS method String. prototype.concat().
2) If current container is an ARRAY, then this method will create new ARRAY container, will add all values of the current container to the new one and will join all the sources one by one. Depending on the source value different logic will be applied during concatenation. If source is an ARRAY container or equivalent raw value, then its own values will be added instead of source itself, otherwise source will be added as a value to the end of new ARRAY container. This is a precise implementation of JS method Array. prototype.concat().
3) For all other containers this method will throw ContainerException with a description that this method
is not supported.
Note: concatenating array(s)/value(s) will leave the originals untouched. Furthermore, any operation on the new ARRAY container (only if the element is not object reference) will have no effect on the original array(s)/value(s), and vice versa.
sources - list of values, that should be joined with the current container, all raw values will be wrapped
into corresponding containers.ContainerException - if current container is not STRING LITERAL or ARRAY container.public UniversalContainer create()
ContainerException.
Javascript Note: this method emulates static javascript method Object. create(). It's not a precise implementation since current method is not static and parameter propertiesObject is missing. As an example following expression:
Object.create(obj); can be
replaced with something like this: obj.create();ContainerException - if current container is not ARRAY, OBJECT or NULL container.public void delete(int index)
ContainerException.
Note: this method mutates current OBJECT or ARRAY container.
Javascript Note: this method emulates javascript delete operator. As an example following expression:
delete obj[index]; can be replaced with
something like this: obj.delete(index);index - position in the container, which will be removed.ContainerException - if current container is not ARRAY or OBJECT container.public void delete(String property)
ContainerException.
Note: this method mutates current OBJECT or ARRAY container.
Javascript Note: this method emulates javascript delete operator. As an example following expressions:
delete obj[property];
delete obj.property; can be replaced with something like this:
obj.delete(property);property - name of the property in the container, which will be removed.ContainerException - if current container is not ARRAY or OBJECT container.public boolean has(int index)
has(index, true);index - position of value, which will be checked.has(int, boolean)public boolean has(String property)
has(property, true);property - name of the property, which will be checked.has(String, boolean)public boolean has(int index,
boolean own)
Javascript Note: this method is a wild combination of javascript standard method Object.prototype.hasOwnProperty() and two Lodash's methods has() and hasIn(). As an example following expressions:
obj.hasOwnProperty(index);_.has(obj, index); can
be replaced with something like this: obj.has(index, true); And following
expression: _.hasIn(obj, index); can be replaced with something like this:
obj.has(index, false);index - position of value, which will be checked.own - if true method will scan only current container for an index; otherwise it will also search among
inherited indexes from the prototype.public boolean has(String property, boolean own)
Javascript Note: this method is a wild combination of javascript standard method Object.prototype.hasOwnProperty() and two Lodash's methods has() and hasIn(). As an example following expressions:
obj.hasOwnProperty(property);
_.has(obj, property); can be replaced with something like this:
obj.has(property, true); And following expression:
_.hasIn(obj, property); can be replaced with something like this:
obj.has(property, false);property - name of the property, which will be checked.own - if true method will scan only current container for a property; otherwise it will also search among
inherited properties from the prototype.public int indexOf(Object value)
1) If current container is a STRING LITERAL, then method will convert given value to a STRING LITERAL and will return the index in the current string of the first occurence of the specified substring. If substring won't be found, then method will return -1. This is a precise implementation of JS method String. prototype.indexOf(), except parameter fromIndex isn't implemented. To find substring method checks not only current container, but the whole prototype chain.
2) If current container is an ARRAY, then method will return first index at which a given value can be found in
the ARRAY container. For comparison method equals(Object) will be used. If value won't be found, then
method will return -1. This is almost a precise implementation of JS method
Array.
prototype.indexOf(), except parameter fromIndex isn't implemented. To find the value method checks not only
current container, but the whole prototype chain.
3) For all other containers this method will throw ContainerException with a description that this method
is not supported.
value - any value that will be searched in the container.ContainerException - if current container is not STRING LITERAL or ARRAY container.equals(Object)public Set<String> keys()
keys(true);keys(boolean)public Set<String> keys(boolean own)
Javascript Note: this method is a wild combination of javascript standard method Object. keys() and Lodash's methods keys() and keysIn(). As an example following expressions:
Object.keys(obj); _.keys(obj); can be replaced
with something like this: obj.keys(true); And following expression:
_.keysIn(obj); can be replaced with something like this:
obj.keys(false);own - if true only own indexes/properties will be returned, otherwise all indexes/properties will be
returned, including inhereted ones.public UniversalContainer pop()
ContainerException. To get the value method checks not only current container, but the whole
prototype chain.
Note: this method mutates current container.
Javascript Note: this is a precise implementation of javascript method Array. prototype.pop().
ContainerException - if current container is not ARRAY container or container, which doesn't have ARRAY in
its prototype chain.push(Object...)public int push(Object... values)
ContainerException.
Note: this method mutates current container.
Javascript Note: this is a precise implementation of javascript method Array. prototype.push().
values - variable number values that will be added to the end of the current ARRAY container, can be any
object (raw values, other containers etc).ContainerException - if current container is not ARRAY container or container, which doesn't have ARRAY in
its prototype chain.pop()public UniversalContainer shift()
ContainerException. To get the value method checks not only current container, but the whole
prototype chain.
Note: this method mutates current container.
Javascript Note: this is a precise implementation of javascript method Array. prototype.shift().
ContainerException - if current container is not ARRAY container or container, which doesn't have ARRAY in
its prototype chain.public UniversalContainer splice(int start, int deleteCount)
ContainerException. To get the
values method checks not only current container, but the whole prototype chain.
Note: this method mutates current container.
Javascript Note: this is almost a precise implementation of javascript method Array. prototype.splice(). The only difference is that current implementation doesn't add new elements.
start - index at which to start changing the ARRAY container. If greater than the length property, actual
starting index will be set to the length of the ARRAY container. If negative, will begin that many
elements from the end.deleteCount - an integer indicating the number of elements to remove from current ARRAY container.ContainerException - if current container is not ARRAY container or container, which doesn't have ARRAY in
its prototype chain.public UniversalContainer clone()
Lodash.clone(UniversalContainer) method. This method works as if invoking it were
equivalent to evaluating the expression: Lodash.clone(this);public boolean deepEquals(Object other)
Lodash.isEqual(UniversalContainer, Object) method. This method works as if invoking it
were equivalent to evaluating the expression: Lodash.isEqual(this, other);other - value of any class to compare with the current containerpublic UniversalContainer extend(UniversalContainer... sources)
Lodash.extend(UniversalContainer, UniversalContainer...) method. This method works as
if invoking it were equivalent to evaluating the expression:
Lodash.extend(this, sources);
Note: This method mutates destination OBJECT container.
sources - containers, which will override properties in the destination container.public UniversalContainer last()
Lodash.last(UniversalContainer) method. This method works as if invoking it were
equivalent to evaluating the expression: Lodash.last(this);public UniversalContainer merge(UniversalContainer... sources)
Lodash.merge(UniversalContainer, UniversalContainer...) method. This method works as if
invoking it were equivalent to evaluating the expression:
Lodash.merge(this, sources);
Note: This method mutates destination OBJECT container.
sources - containers, which properties will be merged into the destination container.public UniversalContainer values()
Lodash.values(UniversalContainer) method. This method works as if
invoking it were equivalent to evaluating the expression:
Lodash.values(this);public boolean equals(Object other)
Javascript Note: this is a precise implementation of javascript strict equality. Loose equality usualy not in use and won't be implemented.
equals in class Objectother - any value, that will be compared with the current container.deepEquals(Object)public Iterator<UniversalContainer> iterator()
Javascript Note: created to mimic javascript for, for in and each methods.
iterator in interface Iterable<UniversalContainer>keys(boolean)public String toString()
asString() method,
the only difference is that current method will return "undefined" and "null" strings for UNDEFINED and NULL
containers accordingly.toString in class ObjectasString()