Class SimpleDerivedAttributeLoader<T,D>
Object
AbstractAttributeLoader<T>
AbstractDerivedAttributeLoader<T>
SimpleDerivedAttributeLoader<T,D>
- All Implemented Interfaces:
AttributeLoader<T>,DerivedAttributeLoader<T>
- Direct Known Subclasses:
UniDerivedAttributeLoaderBuilder.BuiltDerivedLoader
-
Field Summary
FieldsFields inherited from class AbstractAttributeLoader
mySpec -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleDerivedAttributeLoader(AttributeSpec<T> spec, AttributeSpec<? extends D> dependency) protectedSimpleDerivedAttributeLoader(AttributeSpec<T> spec, AttributeSpec<? extends D> dependency, boolean yield) -
Method Summary
Modifier and TypeMethodDescriptionfinal Set<AttributeSpec<?>>Returns attributes that need to be loaded prior to calling this loader's loading function.protected abstract TgetValue(D value, DerivedAttributeContext context) static <T> AttributeLoader<T>idLoader(AttributeSpec<T> spec, AttributeSpec<T> dependency) 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, getCachingStrategy, getContextDependencies, getGlobalTrail
-
Field Details
-
myDependency
-
-
Constructor Details
-
SimpleDerivedAttributeLoader
protected SimpleDerivedAttributeLoader(AttributeSpec<T> spec, AttributeSpec<? extends D> dependency) -
SimpleDerivedAttributeLoader
protected SimpleDerivedAttributeLoader(AttributeSpec<T> spec, AttributeSpec<? extends D> dependency, boolean yield) - Parameters:
spec-dependency-yield- if true, then error and null values will be returned as null, thus allowing other loaders to provide other values for the attribute; if false, this method will always return something
-
-
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
- Parameters:
value-context-- Returns:
- null if the result should be undefined (or yielded to other loaders)
-
idLoader
-