|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.template.soy.data.SoyData
com.google.template.soy.data.restricted.CollectionData
com.google.template.soy.data.SoyMapData
public class SoyMapData
A map data node in a Soy data tree.
| Constructor Summary | |
|---|---|
SoyMapData()
|
|
SoyMapData(Map<String,?> data)
Constructor that initializes this SoyMapData from an existing map. |
|
SoyMapData(Object... data)
Constructor that directly takes the keys/values as parameters. |
|
| Method Summary | |
|---|---|
Map<String,SoyData> |
asMap()
Important: Please treat this method as superpackage-private. |
boolean |
equals(Object other)
Compares this data object against another for equality in the sense of the operator '==' for Soy expressions. |
Set<String> |
getKeys()
Gets the keys in this map data. |
SoyData |
getSingle(String key)
Important: Do not use outside of Soy code (treat as superpackage-private). |
void |
putSingle(String key,
SoyData value)
Important: Do not use outside of Soy code (treat as superpackage-private). |
void |
removeSingle(String key)
Important: Do not use outside of Soy code (treat as superpackage-private). |
boolean |
toBoolean()
Converts this data object into a boolean (e.g. |
String |
toString()
Converts this data object into a string (e.g. |
protected String |
toStringHelper(Map<String,SoyData> map)
Protected helper for {toString()}. |
| Methods inherited from class com.google.template.soy.data.restricted.CollectionData |
|---|
ensureValidValue, get, getBoolean, getFloat, getInteger, getListData, getMapData, getString, put, put, put, put, put, put, remove |
| Methods inherited from class com.google.template.soy.data.SoyData |
|---|
booleanValue, createFromExistingData, createFromExistingData, floatValue, integerValue, numberValue, stringValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SoyMapData()
public SoyMapData(Map<String,?> data)
data - The initial data in an existing map.public SoyMapData(Object... data)
data - The initial data, with alternating keys/values.| Method Detail |
|---|
public Map<String,SoyData> asMap()
public Set<String> getKeys()
public String toString()
This method should only be used for debugging purposes.
toString in class SoyDataprotected String toStringHelper(Map<String,SoyData> map)
map - The map to turn into a string.
public boolean toBoolean()
A map is always truthy.
toBoolean in class SoyDatapublic boolean equals(Object other)
SoyData
equals in class SoyDataother - The other data object to compare against.
public void putSingle(String key,
SoyData value)
putSingle in class com.google.template.soy.data.restricted.CollectionDatakey - An individual key.value - The data to put at the specified key.public void removeSingle(String key)
removeSingle in class com.google.template.soy.data.restricted.CollectionDatakey - An individual key.public SoyData getSingle(String key)
getSingle in class com.google.template.soy.data.restricted.CollectionDatakey - An individual key.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||