Interface LoadedValue<T>
- Type Parameters:
T- value type
@PublicApi
public interface LoadedValue<T>
Represents a value loaded from the attribute system. Contains the AttributeValue and a boolean outdated flag.
Note that the object is immutable with regards to the attribute value only. Outdated flag may change from false to true
once during the lifespan of a loaded value.
- See Also:
-
LoadedValuesStructureAttributeService.getAttributeValues(com.almworks.jira.structure.api.forest.ForestSpec, boolean, com.almworks.integers.LongList, java.util.Collection<? extends com.almworks.jira.structure.api.attribute.AttributeSpec<?>>, java.util.function.Consumer<com.almworks.jira.structure.api.attribute.ValuesMeta>)
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()Returns the loaded attribute value.booleanReturnstrueif this value has been outdated.static <T> LoadedValue<T>of(AttributeValue<T> attributeValue) Creates an instance ofLoadedValuebased on attribute value.static <T> LoadedValue<T>of(T value) Creates an instance ofLoadedValuebased on a value itself.
-
Method Details
-
getValue
Returns the loaded attribute value.- Returns:
- attribute value
-
isOutdated
boolean isOutdated()Returns
trueif this value has been outdated. An outdated value will be recalculated next time it is requested.A value may be outdated right away, or it may become outdated later.
- Returns:
- true if the value is outdated
-
of
Creates an instance ofLoadedValuebased on attribute value. This loaded value will never be outdated.- Type Parameters:
T- value type- Parameters:
attributeValue- attribute value- Returns:
- loaded value
-
of
Creates an instance ofLoadedValuebased on a value itself. This loaded value will never be outdated.- Type Parameters:
T- value type- Parameters:
value- value- Returns:
- loaded value
-