public static class UniDerivedAttributeLoaderBuilder.BuiltDerivedLoader<T,D> extends SimpleDerivedAttributeLoader<T,D>
myDependency
mySpec
Constructor and Description |
---|
BuiltDerivedLoader(AttributeSpec<T> spec,
AttributeSpec<? extends D> dependency,
boolean yield,
BiFunction<? super D,DerivedAttributeContext,? extends T> derivationFunction,
Function<D,ItemIdentity> trailFunction,
Set<AttributeContextDependency> contextDependencies,
AttributeCachingStrategy cachingStrategy,
TrailItemSet globalTrail) |
Modifier and Type | Method and Description |
---|---|
AttributeCachingStrategy |
getCachingStrategy()
Indicates how the values provided by this loader should be cached.
|
Set<AttributeContextDependency> |
getContextDependencies()
Indicates which context values are used to calculate the value of the attribute.
|
TrailItemSet |
getGlobalTrail()
Returns global trail.
|
protected T |
getValue(D value,
DerivedAttributeContext context) |
getAttributeDependencies, idLoader, loadValue
getAttributeSpec, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAttributeSpec
public BuiltDerivedLoader(AttributeSpec<T> spec, AttributeSpec<? extends D> dependency, boolean yield, BiFunction<? super D,DerivedAttributeContext,? extends T> derivationFunction, Function<D,ItemIdentity> trailFunction, Set<AttributeContextDependency> contextDependencies, AttributeCachingStrategy cachingStrategy, TrailItemSet globalTrail)
@Nullable protected T getValue(@NotNull D value, DerivedAttributeContext context)
getValue
in class SimpleDerivedAttributeLoader<T,D>
@Nullable public Set<AttributeContextDependency> getContextDependencies()
AttributeLoader
Indicates which context values are used to calculate the value of the attribute.
For example, if the calculated value depends on the current user, the return value from this method must include
AttributeContextDependency.USER
.
The returned value must be the same throughout the lifetime of the object.
null
if there are none@Nullable public AttributeCachingStrategy getCachingStrategy()
AttributeLoader
Indicates how the values provided by this loader should be cached.
The returned value must be the same throughout the lifetime of the object.
null
has the same effect as AttributeCachingStrategy.MAY
@Nullable public TrailItemSet getGlobalTrail()
AttributeLoader
Returns global trail. When an item from a global trail changes, all values calculated for this attribute will be invalidated and will need to be recalculated.
The returned value must be the same throughout the lifetime of the object.
null
if noneCopyright © 2024 Tempo Software. All Rights Reserved.