Interface LoadedValues<K>

Type Parameters:
K - type of the key - either Long for row-based values or ItemIdentity for item-based values.
All Known Subinterfaces:
ItemValues, RowValues

@PublicApi public interface LoadedValues<K>

An interface that allows access to attribute values, loaded via the attribute system.

  • Method Details

    • getLoadedValue

      @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).

      Type Parameters:
      T - type of the value
      Parameters:
      key - either row ID or item ID
      attribute - attribute
      Returns:
      loaded value, or null if it is not present
    • getAttributeValue

      @Nullable default <T> AttributeValue<T> getAttributeValue(@Nullable K key, @Nullable AttributeSpec<T> attribute)
      Returns the AttributeValue loaded for the given key and attribute.
      Type Parameters:
      T - type of the value
      Parameters:
      key - either row ID or item ID
      attribute - attribute
      Returns:
      attribute value, or null if it is not present
    • isOutdated

      default 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().

      Parameters:
      key - either row ID or item ID
      attribute - attribute
      Returns:
      true if the value is outdated
    • get

      @Nullable default <T> T get(@Nullable K key, @Nullable AttributeSpec<T> attribute)
      Returns a value for the given row and attribute.
      Type Parameters:
      T - type of the value
      Parameters:
      key - either row ID or item ID
      attribute - attribute
      Returns:
      the value, or null if it is not present or undefined