public final class RecordType extends Object implements SoyObjectType
Important: Do not use outside of Soy code (treat as superpackage-private).
SoyType.Kind| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
String |
getFieldAccessor(String fieldName,
SoyBackendKind backendKind)
Return the expression (including the leading '.' or '[') used to access
the value of the field, for a given output context.
|
String |
getFieldImport(String fieldName,
SoyBackendKind backend)
In some cases, accessing a field requires importing a symbol into the
generated code (example being protobuf extension fields which require
importing the extension type).
|
SoyType |
getFieldType(String fieldName)
Return the data type of the field with the given name; If there's no such
field, then return
null. |
SoyType.Kind |
getKind()
Returns what kind of type this is.
|
com.google.common.collect.ImmutableSortedMap<String,SoyType> |
getMembers()
Return the members of this record type.
|
String |
getName()
Return the fully-qualified name of this object type.
|
String |
getNameForBackend(SoyBackendKind backend)
Return the fully-qualified name of this type for a given output context.
|
int |
hashCode() |
boolean |
isAssignableFrom(SoyType srcType)
Returns true if a parameter or field of this type can be assigned from
a value of
srcType. |
boolean |
isInstance(SoyValue value)
Returns true if the given value is an instance of this type.
|
Class<? extends SoyValue> |
javaType()
Returns the java class for the the SoyValue subclass that is used to represent this type.
|
static RecordType |
of(Map<String,SoyType> members) |
String |
toString() |
public static RecordType of(Map<String,SoyType> members)
public SoyType.Kind getKind()
SoyTypepublic boolean isAssignableFrom(SoyType srcType)
SoyTypesrcType.isAssignableFrom in interface SoyTypesrcType - The type of the incoming value.public boolean isInstance(SoyValue value)
SoyTypeisInstance in interface SoyTypevalue - The value to test.public Class<? extends SoyValue> javaType()
SoyTypepublic String getName()
SoyObjectTypegetName in interface SoyObjectTypepublic com.google.common.collect.ImmutableSortedMap<String,SoyType> getMembers()
public String getNameForBackend(SoyBackendKind backend)
SoyObjectTypegetNameForBackend in interface SoyObjectTypebackend - Which backend we're generating code for.public SoyType getFieldType(String fieldName)
SoyObjectTypenull.getFieldType in interface SoyObjectTypefieldName - The name of the field.public String getFieldAccessor(String fieldName, SoyBackendKind backendKind)
SoyObjectTypegetFieldAccessor in interface SoyObjectTypefieldName - Name of the field.backendKind - Which backend we're generating code for.public String getFieldImport(String fieldName, SoyBackendKind backend)
SoyObjectTypenull.getFieldImport in interface SoyObjectTypefieldName - The name of the field being accessed.backend - Which backend we're generating code for.