SoyType.Kind| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
SoyType.Kind |
getKind()
Returns what kind of type this is.
|
Set<SoyType> |
getMembers()
Return the set of types contained in this union.
|
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.
|
boolean |
isNullable()
Returns true if the union includes the null type.
|
Class<? extends SoyValue> |
javaType()
Returns the java class for the the SoyValue subclass that is used to represent this type.
|
static SoyType |
of(Collection<SoyType> members)
Create a union from a collection of types.
|
static SoyType |
of(SoyType... members)
Convenience method for creating unions.
|
SoyType |
removeNullability()
Returns a Soy type that is equivalent to this one but with 'null' removed.
|
String |
toString() |
public static SoyType of(SoyType... members)
members - Member types of the union.public static SoyType of(Collection<SoyType> members)
members - Member types of the union.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 boolean isNullable()
public SoyType removeNullability()