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 T
getValue
(X x, Y y, DerivedAttributeContext context) loadValue
(DerivedAttributeContext context) Performs the loading.Methods inherited from class AbstractAttributeLoader
getAttributeSpec, toString
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:AttributeLoader
Returns 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
null
if there are none - See Also:
-
loadValue
Description copied from interface:DerivedAttributeLoader
Performs 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: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.
- Returns:
- the set of context dependencies or
null
if there are none
-
getCachingStrategy
Description copied from interface: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.
- Returns:
- caching strategy,
null
has the same effect asAttributeCachingStrategy.MAY
-
getGlobalTrail
Description copied from interface: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.
- Returns:
- global trail set, or
null
if none
-