Class BaseAttributeLoader<T>
- All Implemented Interfaces:
AttributeLoader<T>
- Direct Known Subclasses:
BaseDerivedAttributeLoader,BaseItemAttributeLoader,BaseSingleRowAttributeLoader
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseAttributeLoader(AttributeSpec<T> attributeSpec, Set<AttributeSpec<?>> dependencies, Set<AttributeContextDependency> contextDependencies, AttributeCachingStrategy cachingStrategy, TrailItemSet globalTrail) Creates the loader. -
Method Summary
Modifier and TypeMethodDescriptionSet<AttributeSpec<?>>Returns attributes that need to be loaded prior to calling this loader's loading function.Returns the spec for which this loader loads values.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.
-
Constructor Details
-
BaseAttributeLoader
protected BaseAttributeLoader(@NotNull AttributeSpec<T> attributeSpec, @Nullable Set<AttributeSpec<?>> dependencies, @Nullable Set<AttributeContextDependency> contextDependencies, @Nullable AttributeCachingStrategy cachingStrategy, @Nullable TrailItemSet globalTrail) Creates the loader. All collections passed must be immutable.
-
-
Method Details
-
getAttributeSpec
Description copied from interface:AttributeLoaderReturns the spec for which this loader loads values.
The returned value must be the same throughout the lifetime of the object.
- Specified by:
getAttributeSpecin interfaceAttributeLoader<T>- Returns:
- spec being loaded
-
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.
- Specified by:
getAttributeDependenciesin interfaceAttributeLoader<T>- Returns:
- the set of attribute dependencies, or
nullif there are none - See Also:
-
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.
- Specified by:
getContextDependenciesin interfaceAttributeLoader<T>- 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.
- Specified by:
getCachingStrategyin interfaceAttributeLoader<T>- 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.
- Specified by:
getGlobalTrailin interfaceAttributeLoader<T>- Returns:
- global trail set, or
nullif none
-