Class BiDerivedAttributeLoaderBuilder.BuiltBiDerivedLoader<T,X,Y>
- All Implemented Interfaces:
AttributeLoader<T>,DerivedAttributeLoader<T>
- Enclosing class:
- BiDerivedAttributeLoaderBuilder<T,
X, Y>
-
Field Summary
Fields inherited from class AbstractAttributeLoader
mySpec -
Constructor Summary
ConstructorsConstructorDescriptionBuiltBiDerivedLoader(AttributeSpec<T> spec, AttributeSpec<? extends X> xDependency, AttributeSpec<? extends Y> yDependency, boolean yield, BiFunction<X, Y, T> derivationFunction, Function<X, ItemIdentity> xTrailFunction, Function<Y, ItemIdentity> yTrailFunction, Set<AttributeContextDependency> contextDependencies, AttributeCachingStrategy cachingStrategy, TrailItemSet globalTrail) -
Method Summary
Modifier and TypeMethodDescriptionSet<AttributeSpec<?>>Returns attributes that need to be loaded prior to calling this loader's loading function.Indicates 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(X x, Y y, DerivedAttributeContext context) loadValue(DerivedAttributeContext context) Performs the loading.Methods 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
-
BuiltBiDerivedLoader
public BuiltBiDerivedLoader(AttributeSpec<T> spec, AttributeSpec<? extends X> xDependency, AttributeSpec<? extends Y> yDependency, boolean yield, BiFunction<X, Y, T> derivationFunction, Function<X, ItemIdentity> xTrailFunction, Function<Y, ItemIdentity> yTrailFunction, Set<AttributeContextDependency> contextDependencies, AttributeCachingStrategy cachingStrategy, TrailItemSet globalTrail)
-
-
Method Details
-
getAttributeDependencies
Description copied from interface:AttributeLoaderReturns attributes that need to be loaded prior to calling this loader's loading function.
The returned value must be the same throughout the lifetime of the object.
- Returns:
- the set of attribute dependencies, or
nullif there are none - See Also:
-
loadValue
Description copied from interface:DerivedAttributeLoaderPerforms the loading.
If the value is missing or empty, the loader should return
AttributeValue.undefined(). If for some reason this loader is not applicable for the given row, it should returnnull.- Parameters:
context- loading context- Returns:
- the calculated value
-
getValue
-
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
-