@ParametersAreNonnullByDefault public final class EasyDictImpl extends SoyAbstractMap implements SoyEasyDict
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.
|
| Constructor and Description |
|---|
EasyDictImpl(SoyValueHelper valueHelper)
Important: Do not use outside of Soy code (treat as superpackage-private).\
|
| 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.
|
void |
del(String dottedName)
Deletes a subfield of this dict.
|
void |
delField(String name)
Deletes a field of this dict.
|
SoyValue |
get(String dottedName)
Gets a subfield value of this dict.
|
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(String dottedName)
Gets a provider of a subfield value of this dict.
|
protected String |
getStringKey(SoyValue key) |
boolean |
has(String dottedName)
Checks whether this dict has a subfield at the given dotted name.
|
boolean |
hasField(String name)
Checks whether this SoyRecord has a field of the given name.
|
boolean |
hasItem(SoyValue key)
Checks whether this SoyMap has an item with the given key.
|
SoyEasyDict |
makeImmutable()
Makes this dict immutable.
|
void |
set(String dottedName,
Object value)
Sets a subfield of this dict.
|
void |
setField(String name,
SoyValueProvider valueProvider)
Sets a field of this dict.
|
void |
setFieldsFromJavaStringMap(Map<String,?> javaStringMap)
Sets fields on this dict from a Java string-keyed map.
|
void |
setItemsFromDict(SoyDict dict)
Sets items in this dict from another dict.
|
coerceToBoolean, coerceToString, equals, render, toStringbooleanValue, floatValue, integerValue, longValue, numberValue, renderAndResolve, resolve, status, stringValueclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasJavaStringMap, asResolvedJavaStringMapgetField, getFieldProvider, hasFieldgetItem, getItemCnt, getItemKeys, getItemProvider, hasItembooleanValue, coerceToBoolean, coerceToString, equals, floatValue, integerValue, longValue, numberValue, render, stringValuerenderAndResolve, resolve, statusprotected final Map<String,? extends SoyValueProvider> providerMap
public EasyDictImpl(SoyValueHelper valueHelper)
valueHelper - The instance of SoyValueHelper to use for internal conversions.public void setField(String name, SoyValueProvider valueProvider)
SoyEasyDictsetField in interface SoyEasyDictname - The field name to set.valueProvider - A provider of the field value for the given field name. Note that this is
often just the field value itself, since all values are also providers.public void delField(String name)
SoyEasyDictdelField in interface SoyEasyDictname - The field name to delete.public void setItemsFromDict(SoyDict dict)
SoyEasyDictsetItemsFromDict in interface SoyEasyDictdict - A dict of the fields to set.public void setFieldsFromJavaStringMap(Map<String,?> javaStringMap)
SoyEasyDictsetFieldsFromJavaStringMap in interface SoyEasyDictjavaStringMap - A Java string-keyed map of the fields to set.public void set(String dottedName, @Nullable Object value)
SoyEasyDictset in interface SoyEasyDictdottedName - The dotted name to set (one or more field names, dot-separated).value - The subfield value for the given dotted name. If it's not a SoyValueProvider
(includes SoyValue), it will be converted.public void del(String dottedName)
SoyEasyDictdel in interface SoyEasyDictdottedName - The dotted name to delete (one or more field names, dot-separated).public boolean has(String dottedName)
SoyEasyDicthas in interface SoyEasyDictdottedName - The dotted name to check (one or more field names, dot-separated).public SoyValue get(String dottedName)
SoyEasyDictget in interface SoyEasyDictdottedName - The dotted name to get (one or more field names, dot-separated).public SoyValueProvider getProvider(String dottedName)
SoyEasyDictgetProvider in interface SoyEasyDictdottedName - The dotted name to get (one or more field names, dot-separated).public SoyEasyDict makeImmutable()
SoyEasyDictmakeImmutable in interface SoyEasyDictpublic 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 SoyMap@Nonnull public final Iterable<? extends SoyValue> getItemKeys()
SoyMapgetItemKeys in interface SoyMappublic final boolean hasItem(SoyValue key)
SoyMappublic final SoyValue getItem(SoyValue key)
SoyMapgetItem in interface SoyMapgetItem in class SoyAbstractMapkey - The item key to get.public final SoyValueProvider getItemProvider(SoyValue key)
SoyMapgetItemProvider in interface SoyMapkey - The item key to get.@Nonnull public final Map<String,? extends SoyValueProvider> asJavaStringMap()
SoyDictasJavaStringMap in interface SoyDict@Nonnull public final Map<String,? extends SoyValue> asResolvedJavaStringMap()
SoyDictasResolvedJavaStringMap in interface SoyDict