@ParametersAreNonnullByDefault public abstract class SoyAbstractValue extends Object implements SoyValue
Important: Until this API is more stable and this note is removed, users must not define classes that extend this class.
SoyValueProvider.ResolveStatus| Constructor and Description |
|---|
SoyAbstractValue() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
booleanValue()
Precondition: Only call this method if you know that this SoyValue object is a boolean.
|
boolean |
equals(SoyValueProvider other)
Note: Even though we provide a default implementation for equals(SoyValueProvider), subclasses
must still implement equals(SoyValue).
|
double |
floatValue()
Precondition: Only call this method if you know that this SoyValue object is a float.
|
int |
integerValue()
Precondition: Only call this method if you know that this SoyValue object is a 32-bit integer.
|
long |
longValue()
Precondition: Only call this method if you know that this SoyValue object is an integer
or long.
|
double |
numberValue()
Precondition: Only call this method if you know that this SoyValue object is a number.
|
RenderResult |
render(AdvisingAppendable appendable,
boolean isLast)
Renders this value to the given
AdvisingAppendable, possibly partially. |
SoyValue |
resolve()
Usually, this method is a no-op that simply returns this object.
|
SoyValueProvider.ResolveStatus |
status()
Returns
SoyValueProvider.ResolveStatus.isReady() if the value provider can be
resolved without blocking on a future. |
String |
stringValue()
Precondition: Only call this method if you know that this SoyValue object is a string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcoerceToBoolean, coerceToString, equals, render@Nonnull public SoyValue resolve()
SoyValueProviderresolve in interface SoyValueProvider@Nonnull public SoyValueProvider.ResolveStatus status()
SoyValueProviderSoyValueProvider.ResolveStatus.isReady() if the value provider can be
resolved without blocking on a future. Otherwise, returns a
SoyValueProvider.ResolveStatus that holds the future.
Note, once this method returns SoyValueProvider.ResolveStatus.isReady() all future calls must also
return SoyValueProvider.ResolveStatus.isReady().
status in interface SoyValueProviderpublic boolean equals(SoyValueProvider other)
equals in interface SoyValueProviderother - The other value to compare against.public boolean booleanValue()
SoyValuebooleanValue in interface SoyValuepublic int integerValue()
SoyValueintegerValue in interface SoyValuepublic long longValue()
SoyValuepublic double floatValue()
SoyValuefloatValue in interface SoyValuepublic double numberValue()
SoyValuenumberValue in interface SoyValuepublic String stringValue()
SoyValuestringValue in interface SoyValuepublic RenderResult render(AdvisingAppendable appendable, boolean isLast) throws IOException
SoyValueAdvisingAppendable, possibly partially.
This should render the exact same content as SoyValue.render(Appendable) but may optionally
detach part of the way through rendering. Note, this means that this method is
stateful and if it returns something besides RenderResult.done() then the
next call to this method will resume rendering from the previous point.
It is expected that most implementations will simply delegate to
SoyValue.render(Appendable), since the renderable content is small/trivial.
render in interface SoyValueappendable - The appendable to render to.isLast - True if this is definitely the last time this value will be rendered.
Used as a hint to implementations to not optimize for later calls (for example, by storing
render results in a buffer for faster re-renders). The value of this parameter should not
affect behavior of this method, only performance.IOException - If the appendable throws an IOException