public class ObjectRepresentation extends Representation implements java.lang.Iterable<java.util.Map.Entry<java.lang.String,Representation>>
String -> Representation map.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,Representation> |
map
The map underlying this object representation.
|
| Constructor and Description |
|---|
ObjectRepresentation() |
ObjectRepresentation(java.lang.String key0,
Representation value0)
Constructor for setting a single key-value pair.
|
ObjectRepresentation(java.lang.String key0,
Representation value0,
java.lang.String key1,
Representation value1)
Constructor for setting two key-value pairs.
|
ObjectRepresentation(java.lang.String key0,
Representation value0,
java.lang.String key1,
Representation value1,
java.lang.String key2,
Representation value2)
Constructor for setting three key-value pairs.
|
ObjectRepresentation(java.lang.String key0,
Representation value0,
java.lang.String key1,
Representation value1,
java.lang.String key2,
Representation value2,
java.lang.String key3,
Representation value3)
Constructor for setting four key-value pairs.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
void |
forEach(java.util.function.BiConsumer<java.lang.String,Representation> consumer)
Applies the given consumer function to each key-value pair in the underlying map.
|
void |
forEachOrderedByKeys(java.util.function.BiConsumer<java.lang.String,Representation> consumer)
Applies the given consumer function to each key-value pair in the underlying map sorted by key.
|
Representation |
get(java.lang.String name)
Retrieves the value belonging to the given key.
|
java.util.Map<java.lang.String,Representation> |
getMap()
Retrieves an immutable view of the map underlying this representation.
|
int |
hashCode() |
java.util.Iterator<java.util.Map.Entry<java.lang.String,Representation>> |
iterator()
Returns an iterator over the underlying map's entry set sorted by key.
|
void |
put(java.lang.String key,
Representation value)
Stores the given value under the given key.
|
Representation |
putIfMissing(java.lang.String key,
java.util.function.Supplier<Representation> generatorOfValueToPut)
If key is not in this ObjectRepresentation, calls the supplier and inserts into this ObjectRepresentation
whatever it returns.
|
int |
size()
Returns the number of key-value pairs stored in this object representation (size of the underlying map)
|
java.util.stream.Stream<java.util.Map.Entry<java.lang.String,Representation>> |
stream()
Returns a stream with the underlying map's entry set as its source.
|
java.lang.String |
toString() |
bigInt, bytes, list, map, obj, repr, strprotected final java.util.Map<java.lang.String,Representation> map
public ObjectRepresentation()
public ObjectRepresentation(java.lang.String key0,
Representation value0)
public ObjectRepresentation(java.lang.String key0,
Representation value0,
java.lang.String key1,
Representation value1)
public ObjectRepresentation(java.lang.String key0,
Representation value0,
java.lang.String key1,
Representation value1,
java.lang.String key2,
Representation value2)
public ObjectRepresentation(java.lang.String key0,
Representation value0,
java.lang.String key1,
Representation value1,
java.lang.String key2,
Representation value2,
java.lang.String key3,
Representation value3)
public void put(java.lang.String key,
Representation value)
public Representation putIfMissing(java.lang.String key, java.util.function.Supplier<Representation> generatorOfValueToPut)
Representation stored at the given key after this operationpublic Representation get(java.lang.String name)
public java.util.Map<java.lang.String,Representation> getMap()
public java.util.Iterator<java.util.Map.Entry<java.lang.String,Representation>> iterator()
iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,Representation>>public java.util.stream.Stream<java.util.Map.Entry<java.lang.String,Representation>> stream()
public void forEach(java.util.function.BiConsumer<java.lang.String,Representation> consumer)
consumer - the consumer function to applypublic void forEachOrderedByKeys(java.util.function.BiConsumer<java.lang.String,Representation> consumer)
consumer - the consumer function to applypublic int size()
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object