public abstract class SoyAbstractCachingValueProvider extends Object implements SoyValueProvider
SoyAbstractCachingValueProvider is thread-safe, but in a race condition, may compute its value twice.
Important: Do not use outside of Soy code (treat as superpackage-private).
| Modifier and Type | Class and Description |
|---|---|
static class |
SoyAbstractCachingValueProvider.ValueAssertion
A mechanism to plug in assertions on the computed value that will be run the first time the
value is
computed. |
SoyValueProvider.ResolveStatus| Constructor and Description |
|---|
SoyAbstractCachingValueProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
addValueAssertion(SoyAbstractCachingValueProvider.ValueAssertion assertion)
Registers a
SoyAbstractCachingValueProvider.ValueAssertion callback with this caching provider. |
protected abstract SoyValue |
compute()
Implemented by subclasses to do the heavy-lifting for resolving.
|
boolean |
equals(Object other) |
boolean |
equals(SoyValueProvider other)
Compares this value against another for equality for the purposes of Soy.
|
int |
hashCode() |
boolean |
isComputed()
Returns
true if the caching provider has already been calculated. |
SoyValue |
resolve()
Usually, this method is a no-op that simply returns this object.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitstatuspublic final SoyValue resolve()
SoyValueProviderresolve in interface SoyValueProviderpublic boolean equals(SoyValueProvider other)
SoyValueProviderequals in interface SoyValueProviderother - The other value to compare against.public final boolean isComputed()
true if the caching provider has already been calculated.public void addValueAssertion(SoyAbstractCachingValueProvider.ValueAssertion assertion)
SoyAbstractCachingValueProvider.ValueAssertion callback with this caching provider.protected abstract SoyValue compute()