K
- type of the key - either Long
for row-based values or ItemIdentity
for item-based values.@PublicApi
public interface LoadedValues<K>
An interface that allows access to attribute values, loaded via the attribute system.
Modifier and Type | Method and Description |
---|---|
default <T> T |
get(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 the
AttributeValue loaded 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 boolean |
isOutdated(K key,
AttributeSpec<?> attribute)
Checks if the value for the given key and attribute is outdated (up for recalculation).
|
@Nullable <T> LoadedValue<T> getLoadedValue(@Nullable K key, @Nullable AttributeSpec<T> attribute)
Returns the value loaded for the given key and attribute.
This method may return null
if the attribute and the key were not actually requested, or if the
value hasn't been loaded yet.
Note that null
is not actually an attribute value, it's an absence of a value. It's not the same
as AttributeValue.undefined()
(although they would be probably displayed in the same way).
T
- type of the valuekey
- either row ID or item IDattribute
- attributenull
if it is not present@Nullable default <T> AttributeValue<T> getAttributeValue(@Nullable K key, @Nullable AttributeSpec<T> attribute)
AttributeValue
loaded for the given key and attribute.T
- type of the valuekey
- either row ID or item IDattribute
- attributenull
if it is not presentdefault boolean isOutdated(@Nullable K key, @Nullable AttributeSpec<?> attribute)
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 least AttributeValue.undefined()
.
key
- either row ID or item IDattribute
- attribute@Nullable default <T> T get(@Nullable K key, @Nullable AttributeSpec<T> attribute)
T
- type of the valuekey
- either row ID or item IDattribute
- attributenull
if it is not present or undefinedCopyright © 2024 Tempo Software. All Rights Reserved.