@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 |
coerceToBoolean()
Coerces this value into a boolean.
|
String |
coerceToString()
Coerces this value into a string.
|
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.
|
String |
toString() |
rendercreateFromExistingDatabooleanValue, floatValue, integerValue, longValue, numberValue, render, renderAndResolve, resolve, statusclone, finalize, getClass, notify, notifyAll, wait, wait, waitbooleanValue, floatValue, integerValue, longValue, numberValue, render, 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 boolean coerceToBoolean()
The empty string is falsy.
coerceToBoolean in interface SoyValuepublic String coerceToString()
SoyValuecoerceToString in interface SoyValuepublic boolean equals(Object other)
SoyValueequals in interface SoyValueequals in class SoyAbstractValueother - The other value to compare against.