@ParametersAreNonnullByDefault public final class SoyMapImpl extends SoyAbstractValue implements SoyMap
This is a new implementation (compared to DictImpl) that was designed for supporting
proto map. There are two different Soy map types, one uses ES6 map in JS, and another uses plain
object.
| Modifier and Type | Method and Description |
|---|---|
Map<? extends SoyValue,? extends SoyValueProvider> |
asJavaMap()
Gets a Java map of all items in this SoyMap, where mappings are value to value provider.
|
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 SoyMapImpl |
forProviderMap(Map<? extends SoyValue,? extends SoyValueProvider> providerMap)
Creates a SoyDict implementation for a particular underlying provider map.
|
SoyValue |
get(SoyValue key)
Gets an item value of this SoyMap.
|
SoyValueProvider |
getProvider(SoyValue key)
Gets a provider of an item value of this SoyMap.
|
int |
hashCode() |
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, statuspublic static SoyMapImpl forProviderMap(Map<? extends SoyValue,? extends SoyValueProvider> providerMap)
public int size()
SoyMap@Nonnull public final Iterable<? extends SoyValue> keys()
SoyMapImportant: Iteration order is undefined.
public boolean containsKey(SoyValue key)
SoyMapcontainsKey in interface SoyMapkey - The item key to check.public SoyValue get(SoyValue key)
SoyMappublic SoyValueProvider getProvider(SoyValue key)
SoyMapgetProvider in interface SoyMapkey - The item key to get.@Nonnull public Map<? extends SoyValue,? extends SoyValueProvider> asJavaMap()
SoyMappublic boolean coerceToBoolean()
SoyValuecoerceToBoolean in interface SoyValuepublic 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 boolean equals(Object other)
SoyValueequals in interface SoyValueequals in class SoyAbstractValueother - The other value to compare against.