T
- type of the loaded value@PublicSpi public interface DerivedAttributeLoader<T> extends AttributeLoader<T>
Derived loaders calculate the attribute value based only on the attribute dependencies. The dependencies are loaded by some other loaders and may be item or row based, or they may be other derived attributes.
Values calculated by derived attribute loaders are stored in the per-item cache only if they depend on other per-item attributes, otherwise they are stored in the per-forest cache.
The loader must be a stable function, based on the dependency values. It must not depend on any other inputs, and should
provide the same result for the same inputs every time: V(row) = DERIVED(dependencies(row))
.
AttributeLoader
Modifier and Type | Method and Description |
---|---|
AttributeValue<T> |
loadValue(DerivedAttributeContext context)
Performs the loading.
|
getAttributeDependencies, getAttributeSpec, getCachingStrategy, getContextDependencies, getGlobalTrail
@Nullable AttributeValue<T> loadValue(@NotNull DerivedAttributeContext context)
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 return null
.
context
- loading contextCopyright © 2024 Tempo Software. All Rights Reserved.