public class YamlObject
extends java.lang.Object
put(String, Object) and get with get(String).
Collection attributes can be created with with(String, Object).| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ID |
static java.lang.String |
TYPE |
| Constructor and Description |
|---|
YamlObject() |
YamlObject(java.lang.String id) |
YamlObject(java.lang.String id,
java.lang.String type) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get(java.lang.String property) |
java.lang.String |
getId()
|
java.util.LinkedHashMap<java.lang.String,java.lang.Object> |
getMap()
Deprecated.
since 1.2; use
getProperties() instead |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties() |
java.lang.String |
getType()
|
YamlObject |
put(java.lang.String property,
java.lang.Object value)
Sets the attribute value for the given property name.
|
void |
setId(java.lang.String id)
|
void |
setType(java.lang.String type)
|
java.lang.String |
toString() |
YamlObject |
with(java.lang.String property,
java.lang.Object item)
Adds the item to the collection attribute with the given property name.
|
public static final java.lang.String ID
public static final java.lang.String TYPE
public YamlObject()
public YamlObject(java.lang.String id)
id - the id@Deprecated public java.util.LinkedHashMap<java.lang.String,java.lang.Object> getMap()
getProperties() insteadpublic java.util.Map<java.lang.String,java.lang.Object> getProperties()
public java.lang.String getId()
get(ID).
In particular, roughly implemented as
final Object id = this.get(ID);
return id != null ? id.toString() : null;
public void setId(java.lang.String id)
id - the IDpublic java.lang.String getType()
get(TYPE).
In particular, roughly implemented as
final Object type = this.get(TYPE);
return type != null ? type.toString() : null;
public void setType(java.lang.String type)
type - the typepublic java.lang.Object get(java.lang.String property)
property - the property namenull if not specifiedpublic YamlObject put(java.lang.String property, java.lang.Object value)
property - the property namevalue - the attribute valuepublic YamlObject with(java.lang.String property, java.lang.Object item)
put(String, Object)(property, item) was calledList, add the item to that listList,
create a new list with the old value and the item and set that as the new valueproperty - the property nameitem - the item to add or setpublic java.lang.String toString()
toString in class java.lang.Object