Interface MapValue<K,V>

All Superinterfaces:
Value<Map<K,V>>
All Known Subinterfaces:
MapValue.Immutable<K,V>, MapValue.Mutable<K,V>

public interface MapValue<K,V> extends Value<Map<K,V>>
  • Method Details

    • mutableOf

      static <K, V> MapValue.Mutable<K,V> mutableOf(Key<? extends MapValue<K,V>> key, Map<K,V> element)
      Constructs a mutable MapValue of the appropriate type based on the given Key and the element.
      Type Parameters:
      K - The map key type
      V - The map value type
      Parameters:
      key - The key
      element - The element
      Returns:
      The constructed mutable value
    • mutableOf

      static <K, V> MapValue.Mutable<K,V> mutableOf(Supplier<? extends Key<? extends MapValue<K,V>>> key, Map<K,V> element)
      Constructs a mutable MapValue of the appropriate type based on the given Key and the element.
      Type Parameters:
      K - The map key type
      V - The map value type
      Parameters:
      key - The key
      element - The element
      Returns:
      The constructed mutable value
    • immutableOf

      static <K, V> MapValue.Immutable<K,V> immutableOf(Key<? extends MapValue<K,V>> key, Map<K,V> element)
      Constructs an immutable MapValue of the appropriate type based on the given Key and the element.
      Type Parameters:
      K - The map key type
      V - The map value type
      Parameters:
      key - The key
      element - The element
      Returns:
      The constructed immutable value
    • immutableOf

      static <K, V> MapValue.Immutable<K,V> immutableOf(Supplier<? extends Key<? extends MapValue<K,V>>> key, Map<K,V> element)
      Constructs an immutable MapValue of the appropriate type based on the given Key and the element.
      Type Parameters:
      K - The map key type
      V - The map value type
      Parameters:
      key - The key
      element - The element
      Returns:
      The constructed immutable value
    • key

      Key<? extends MapValue<K,V>> key()
      Description copied from interface: Value
      Gets the key for this Value.
      Specified by:
      key in interface Value<K>
      Returns:
      The key for this value
    • size

      int size()
      Gets the size of this map.
      Returns:
      The size of this map
    • containsKey

      boolean containsKey(K key)
      Checks if the provided key is contained within this map.
      Parameters:
      key - The key to check
      Returns:
      True if the key is contained
    • containsValue

      boolean containsValue(V value)
      Checks if the provided value is contained within this map.
      Parameters:
      value - The value to check
      Returns:
      True if the value is contained
    • keySet

      Set<K> keySet()
      Gets an Set of all keys contained in this map value.
      Returns:
      The set of keys
    • entrySet

      Set<Map.Entry<K,V>> entrySet()
      Retrieves an Set of the Map.Entrys contained within this map value.
      Returns:
      The immutable set of entries
    • values

      Collection<V> values()
      Retrieves an Collection of all available values within this map.
      Returns:
      The collection of values
    • asMutable

      MapValue.Mutable<K,V> asMutable()
      Description copied from interface: Value
      Retrieves a mutable form of this value. Due to the vague nature of the value itself, some cases can already provide a Value.Mutable instance where this would simply return itself. In other cases, where the retrieved value is an Value.Immutable instance, a new mutable value is created with the same key and values.
      Specified by:
      asMutable in interface Value<K>
      Returns:
      A mutable value
    • asMutableCopy

      MapValue.Mutable<K,V> asMutableCopy()
      Description copied from interface: Value
      Retrieves a copy in the mutable form of this value. The new is created with the same key and values.
      Specified by:
      asMutableCopy in interface Value<K>
      Returns:
      A mutable value
    • asImmutable

      MapValue.Immutable<K,V> asImmutable()
      Description copied from interface: Value
      Retrieves an immutable form of this value. Due to the vague nature of the value itself, some cases can already provide a Value.Immutable instance where this would simply return itself. In other cases, where the retrieved value is a Value.Mutable instance, a new immutable value is created with the same key and values.
      Specified by:
      asImmutable in interface Value<K>
      Returns:
      An immutable value