@Immutable public abstract class StringData extends PrimitiveData implements SoyString
Important: This class may only be used in implementing plugins (e.g. functions, directives).
| Modifier and Type | Field and Description |
|---|---|
static StringData |
EMPTY_STRING
Static instance of StringData with value "".
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
Compares this value against another for equality in the sense of the '==' operator of Soy.
|
static StringData |
forThunk(RenderableThunk thunk)
Returns a StringData instance for the given
RenderableThunk. |
static StringData |
forValue(String value)
Gets a StringData instance for the given value.
|
abstract String |
getValue()
Returns the string value.
|
int |
hashCode() |
String |
stringValue()
Precondition: Only call this method if you know that this SoyValue object is a string.
|
boolean |
toBoolean()
Deprecated.
|
String |
toString()
This was a required method in the old SoyData interface.
|
rendercoerceToBoolean, coerceToString, createFromExistingDatabooleanValue, floatValue, integerValue, longValue, numberValue, renderAndResolve, resolve, statusclone, finalize, getClass, notify, notifyAll, wait, wait, waitbooleanValue, coerceToBoolean, coerceToString, floatValue, integerValue, longValue, numberValue, renderrenderAndResolve, resolve, statuspublic static final StringData EMPTY_STRING
public static StringData forValue(String value)
value - The desired value.public static StringData forThunk(RenderableThunk thunk)
RenderableThunk.public abstract String getValue()
public String stringValue()
SoyValuestringValue in interface SoyValuestringValue in class SoyAbstractValuepublic String toString()
SoyData@Deprecated public boolean toBoolean()
The empty string is falsy.
public boolean equals(Object other)
SoyValueequals in interface SoyValueequals in class SoyAbstractValueother - The other value to compare against.