public final class SoyProtoValue extends SoyAbstractCachingRecord implements SoyProtoTypeImpl.Value, SoyMap
This also implements SoyMap to deal with some uses that require "reflecting" over Soy proto fields. However, this usage is deprecated and will be unsupported when static type checking is used, since it doesn't work with Javascript, which does not support reflection.
| Modifier and Type | Method and Description |
|---|---|
boolean |
coerceToBoolean()
Coerces this value into a boolean.
|
String |
coerceToString()
Coerces this value into a string.
|
boolean |
equals(Object other)
Compares this value against another for equality in the sense of the '==' operator of Soy.
|
SoyValueProvider |
getFieldProviderInternal(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.
|
Collection<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.
|
com.google.protobuf.Message |
getProto()
Returns the underlying message.
|
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.
|
void |
render(Appendable appendable)
Renders this value to the given appendable.
|
String |
toString()
Returns a string that indicates the type of proto held, to assist in debugging Soy type errors.
|
getFieldProvidergetFieldbooleanValue, floatValue, integerValue, longValue, numberValue, renderAndResolve, resolve, status, stringValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetField, getFieldProviderbooleanValue, floatValue, integerValue, longValue, numberValue, stringValuerenderAndResolve, resolve, statuspublic boolean hasField(String name)
SoyRecordpublic SoyValueProvider getFieldProviderInternal(String name)
SoyAbstractCachingRecordgetFieldProviderInternal in class SoyAbstractCachingRecordname - The field name to get.public boolean hasItem(SoyValue key)
SoyMappublic SoyValueProvider getItemProvider(SoyValue key)
SoyMapgetItemProvider in interface SoyMapkey - The item key to get.public SoyValue getItem(SoyValue key)
SoyMappublic Collection<SoyValue> getItemKeys()
SoyMapgetItemKeys in interface SoyMappublic int getItemCnt()
SoyMapgetItemCnt in interface SoyMappublic boolean equals(Object other)
SoyValueequals in interface SoyValueequals in class SoyAbstractValueother - The other value to compare against.public boolean coerceToBoolean()
SoyValuecoerceToBoolean in interface SoyValuepublic void render(Appendable 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 String coerceToString()
SoyValuecoerceToString in interface SoyValuepublic com.google.protobuf.Message getProto()
getProto in interface SoyProtoTypeImpl.Value