Interface LoadedValues<K>
- Type Parameters:
K- type of the key - eitherLongfor row-based values orItemIdentityfor item-based values.
- All Known Subinterfaces:
ItemValues,RowValues
An interface that allows access to attribute values, loaded via the attribute system.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> Tget(K key, AttributeSpec<T> attribute) Returns a value for the given row and attribute.default <T> AttributeValue<T>getAttributeValue(K key, AttributeSpec<T> attribute) Returns theAttributeValueloaded for the given key and attribute.<T> LoadedValue<T>getLoadedValue(K key, AttributeSpec<T> attribute) Returns the value loaded for the given key and attribute.default booleanisOutdated(K key, AttributeSpec<?> attribute) Checks if the value for the given key and attribute is outdated (up for recalculation).
-
Method Details
-
getLoadedValue
Returns the value loaded for the given key and attribute.
This method may return
nullif the attribute and the key were not actually requested, or if the value hasn't been loaded yet. Note thatnullis not actually an attribute value, it's an absence of a value. It's not the same asAttributeValue.undefined()(although they would be probably displayed in the same way).- Type Parameters:
T- type of the value- Parameters:
key- either row ID or item IDattribute- attribute- Returns:
- loaded value, or
nullif it is not present
-
getAttributeValue
@Nullable default <T> AttributeValue<T> getAttributeValue(@Nullable K key, @Nullable AttributeSpec<T> attribute) Returns theAttributeValueloaded for the given key and attribute.- Type Parameters:
T- type of the value- Parameters:
key- either row ID or item IDattribute- attribute- Returns:
- attribute value, or
nullif it is not present
-
isOutdated
Checks if the value for the given key and attribute is outdated (up for recalculation).
If the value for the given attribute and key is not present, this method returns
true. The absence of the value is considered outdated - loading this value should produce something else instead of the null, at leastAttributeValue.undefined().- Parameters:
key- either row ID or item IDattribute- attribute- Returns:
- true if the value is outdated
-
get
Returns a value for the given row and attribute.- Type Parameters:
T- type of the value- Parameters:
key- either row ID or item IDattribute- attribute- Returns:
- the value, or
nullif it is not present or undefined
-