public abstract class SoyData extends SoyAbstractValue
Important: Even though this class is not marked 'final', do not extend this class.
SoyValueProvider.ResolveStatus| Constructor and Description |
|---|
SoyData() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
coerceToBoolean()
Coerces this value into a boolean.
|
String |
coerceToString()
Coerces this value into a string.
|
static SoyData |
createFromExistingData(Object obj)
Creation function for creating a SoyData object out of any existing primitive, data object, or
data structure.
|
abstract boolean |
equals(Object other)
This was a required method in the old SoyData interface.
|
boolean |
equals(SoyValue other)
Compares this value against another for equality in the sense of the '==' operator of Soy.
|
abstract boolean |
toBoolean()
Deprecated.
|
abstract String |
toString()
This was a required method in the old SoyData interface.
|
booleanValue, equals, floatValue, integerValue, longValue, numberValue, render, resolve, status, stringValuepublic static SoyData createFromExistingData(Object obj)
Important: Avoid using this function if you know the type of the object at compile time.
For example, if the object is a primitive, it can be passed directly to methods such as
SoyMapData.put() or SoyListData.add(). If the object is a Map or an Iterable,
you can directly create the equivalent SoyData object using the constructor of
SoyMapData or SoyListData.
If the given object is already a SoyData object, then it is simply returned. Otherwise a new SoyData object will be created that is equivalent to the given primitive, data object, or data structure (even if the given object is null!).
Note that in order for the conversion process to succeed, the given data structure must correspond to a valid SoyData tree. Some requirements include: (a) all Maps within your data structure must have string keys that are identifiers, (b) all non-leaf nodes must be Maps or Lists, (c) all leaf nodes must be null, boolean, int, double, or String (corresponding to Soy primitive data types null, boolean, integer, float, string).
Any object returned from this function should be regarded as immutable; Avoid downcasting to specific types unless you know what you're doing.
obj - The existing object or data structure to convert.SoyDataException - If the given object cannot be converted to SoyData.public boolean equals(SoyValue other)
SoyValueother - The other value to compare against.public abstract boolean equals(Object other)
public boolean coerceToBoolean()
SoyValue@Deprecated public abstract boolean toBoolean()
public String coerceToString()
SoyValuepublic abstract String toString()