@ParametersAreNonnullByDefault public final class DictImpl extends SoyAbstractValue implements SoyDict, SoyNewMap
SoyValueConverter.convert(java.lang.Object).
Important: Do not use outside of Soy code (treat as superpackage-private).
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,? extends SoyValueProvider> |
providerMap
Map containing each data provider.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,? extends SoyValueProvider> |
asJavaStringMap()
Gets a Java map of all items in this SoyDict, where mappings are string to value provider.
|
Map<String,? extends SoyValue> |
asResolvedJavaStringMap()
Gets a Java map of all items in this SoyDict, where mappings are string to value.
|
boolean |
coerceToBoolean()
Coerces this value into a boolean.
|
String |
coerceToString()
Coerces this value into a string.
|
boolean |
containsKey(SoyValue key)
Checks whether this SoyMap has an item with the given key.
|
boolean |
equals(Object other)
Compares this value against another for equality in the sense of the '==' operator of Soy.
|
static DictImpl |
forProviderMap(Map<String,? extends SoyValueProvider> providerMap)
Creates a SoyDict implementation for a particular underlying provider map.
|
SoyValue |
get(SoyValue key)
Gets an item value of this SoyMap.
|
SoyValue |
getField(String name)
Gets a field value of this SoyRecord.
|
SoyValueProvider |
getFieldProvider(String name)
Gets a provider of a field value of this SoyRecord.
|
SoyValue |
getItem(SoyValue key)
Gets an item value of this SoyMap.
|
int |
getItemCnt()
Gets the number of items in this SoyMap.
|
Iterable<? extends SoyValue> |
getItemKeys()
Gets an iterable over all item keys in this SoyMap.
|
SoyValueProvider |
getItemProvider(SoyValue key)
Gets a provider of an item value of this SoyMap.
|
SoyValueProvider |
getProvider(SoyValue key)
Gets a provider of an item value of this SoyMap.
|
protected String |
getStringKey(SoyValue key) |
boolean |
hasField(String name)
Checks whether this SoyRecord has a field of the given name.
|
int |
hashCode() |
boolean |
hasItem(SoyValue key)
Checks whether this SoyMap has an item with the given key.
|
Iterable<? extends SoyValue> |
keys()
Gets an iterable over all item keys in this SoyMap.
|
void |
render(LoggingAdvisingAppendable appendable)
Renders this value to the given appendable.
|
int |
size()
Gets the number of items in this SoyMap.
|
String |
toString() |
booleanValue, floatValue, integerValue, longValue, numberValue, render, renderAndResolve, resolve, status, stringValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitbooleanValue, floatValue, integerValue, longValue, numberValue, render, stringValuerenderAndResolve, resolve, statusprotected final Map<String,? extends SoyValueProvider> providerMap
public static DictImpl forProviderMap(Map<String,? extends SoyValueProvider> providerMap)
The map may be mutable, but will not be mutated by the DictImpl.
public final boolean hasField(String name)
SoyRecordpublic final SoyValue getField(String name)
SoyRecordpublic final SoyValueProvider getFieldProvider(String name)
SoyRecordgetFieldProvider in interface SoyRecordname - The field name to get.public final int getItemCnt()
SoyMapgetItemCnt in interface SoyMappublic int size()
SoyNewMap@Nonnull public final Iterable<? extends SoyValue> getItemKeys()
SoyMapImportant: Iteration order is undefined.
getItemKeys in interface SoyMap@Nonnull public Iterable<? extends SoyValue> keys()
SoyNewMapImportant: Iteration order is undefined.
public final boolean hasItem(SoyValue key)
SoyMappublic boolean containsKey(SoyValue key)
SoyNewMapcontainsKey in interface SoyNewMapkey - The item key to check.public final SoyValue getItem(SoyValue key)
SoyMappublic SoyValue get(SoyValue key)
SoyNewMappublic final SoyValueProvider getItemProvider(SoyValue key)
SoyMapgetItemProvider in interface SoyMapkey - The item key to get.public SoyValueProvider getProvider(SoyValue key)
SoyNewMapgetProvider in interface SoyNewMapkey - The item key to get.@Nonnull public final Map<String,? extends SoyValueProvider> asJavaStringMap()
SoyDictasJavaStringMap in interface SoyDictasJavaStringMap in interface SoyNewMap@Nonnull public final Map<String,? extends SoyValue> asResolvedJavaStringMap()
SoyDictasResolvedJavaStringMap in interface SoyDictasResolvedJavaStringMap in interface SoyNewMappublic final boolean coerceToBoolean()
SoyValuecoerceToBoolean in interface SoyValuepublic final String coerceToString()
SoyValuecoerceToString in interface SoyValuepublic void render(LoggingAdvisingAppendable appendable) throws IOException
SoyValueThis should behave identically to appendable.append(coerceToString()) but is
provided separately to allow more incremental approaches.
render in interface SoyValueappendable - The appendable to render to.IOExceptionpublic final boolean equals(Object other)
SoyValueequals in interface SoyValueequals in class SoyAbstractValueother - The other value to compare against.