Class UniDerivedAttributeLoaderBuilder.BuiltDerivedLoader<T,D>
Object
AbstractAttributeLoader<T>
AbstractDerivedAttributeLoader<T>
SimpleDerivedAttributeLoader<T,D>
BuiltDerivedLoader<T,D>
- All Implemented Interfaces:
AttributeLoader<T>,DerivedAttributeLoader<T>
- Enclosing class:
- UniDerivedAttributeLoaderBuilder<T,
D>
public static class UniDerivedAttributeLoaderBuilder.BuiltDerivedLoader<T,D>
extends SimpleDerivedAttributeLoader<T,D>
-
Field Summary
Fields inherited from class SimpleDerivedAttributeLoader
myDependencyFields inherited from class AbstractAttributeLoader
mySpec -
Constructor Summary
ConstructorsConstructorDescriptionBuiltDerivedLoader(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) -
Method Summary
Modifier and TypeMethodDescriptionIndicates how the values provided by this loader should be cached.Indicates which context values are used to calculate the value of the attribute.Returns global trail.protected TgetValue(D value, DerivedAttributeContext context) Methods inherited from class SimpleDerivedAttributeLoader
getAttributeDependencies, idLoader, loadValueMethods inherited from class AbstractAttributeLoader
getAttributeSpec, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AttributeLoader
getAttributeSpec
-
Constructor Details
-
BuiltDerivedLoader
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)
-
-
Method Details
-
getValue
- Specified by:
getValuein classSimpleDerivedAttributeLoader<T,D> - Returns:
- null if the result should be undefined (or yielded to other loaders)
-
getContextDependencies
Description copied from interface:AttributeLoaderIndicates 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.
- Returns:
- the set of context dependencies or
nullif there are none
-
getCachingStrategy
Description copied from interface:AttributeLoaderIndicates how the values provided by this loader should be cached.
The returned value must be the same throughout the lifetime of the object.
- Returns:
- caching strategy,
nullhas the same effect asAttributeCachingStrategy.MAY
-
getGlobalTrail
Description copied from interface:AttributeLoaderReturns 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.
- Returns:
- global trail set, or
nullif none
-