public final class SoyProtoValueImpl extends SoyAbstractValue implements SoyProtoValue, SoyMap
This 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 | Class and Description |
|---|---|
static class |
SoyProtoValueImpl.Builder
Provides an interface for constructing a SoyProtoValueImpl.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
coerceToBoolean()
Coerces this value into a boolean.
|
String |
coerceToString()
Coerces this value into a string.
|
static SoyProtoValueImpl |
create(com.google.protobuf.Message proto) |
boolean |
equals(Object other)
Compares this value against another for equality in the sense of the '==' operator of Soy.
|
SoyValue |
getField(String name)
Deprecated.
|
SoyValueProvider |
getFieldProvider(String name)
Deprecated.
|
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.
|
SoyValue |
getProtoField(String name)
Gets a value for the field for the underlying proto object.
|
boolean |
hasField(String name)
Deprecated.
|
int |
hashCode() |
boolean |
hasItem(SoyValue key)
Checks whether this SoyMap has an item with the given key.
|
void |
render(LoggingAdvisingAppendable 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.
|
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 SoyProtoValueImpl create(com.google.protobuf.Message proto)
public com.google.protobuf.Message getProto()
getProto in interface SoyProtoValuepublic SoyValue getProtoField(String name)
SoyProtoValuegetProtoField in interface SoyProtoValuename - The proto field name.@Deprecated public boolean hasField(String name)
SoyRecordhasField in interface SoyProtoValuehasField in interface SoyRecordname - The field name to check.@Deprecated public SoyValue getField(String name)
SoyRecordgetField in interface SoyProtoValuegetField in interface SoyRecordname - The field name to get.@Deprecated public SoyValueProvider getFieldProvider(String name)
SoyProtoValuegetFieldProvider in interface SoyProtoValuegetFieldProvider in interface SoyRecordname - The field name to get.public int getItemCnt()
SoyMapgetItemCnt in interface SoyMappublic Collection<SoyValue> getItemKeys()
SoyMapImportant: Iteration order is undefined.
getItemKeys in interface SoyMappublic boolean hasItem(SoyValue key)
SoyMappublic SoyValue getItem(SoyValue key)
SoyMappublic SoyValueProvider getItemProvider(SoyValue key)
SoyMapgetItemProvider in interface SoyMapkey - The item key to get.public boolean equals(Object other)
SoyValueequals in interface SoyValueequals in class SoyAbstractValueother - The other value to compare against.public 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 String toString()