Class KeyValuesCollectionMapImpl

java.lang.Object
io.deephaven.kv.KeyValuesCollectionMapImpl
All Implemented Interfaces:
KeyValuesCollection

public class KeyValuesCollectionMapImpl extends Object implements KeyValuesCollection
  • Method Details

    • withSharedMap

      public static KeyValuesCollection withSharedMap(@NotNull @NotNull Map<KeyPath,KeyValue> map)
      The caller is retaining ownership of the map, thus signifying that the collection is not immutable, and callers must call asImmutable() if they want ownership over their own collection copy.
      Parameters:
      map - the map, which is shared by the caller, and the collection
      Returns:
      the key values collection
    • withExclusiveMap

      public static KeyValuesCollection withExclusiveMap(@NotNull @NotNull Map<KeyPath,KeyValue> map)
      The caller is giving the map to the collection, thus signifying that the collection is immutable.
      Parameters:
      map - the map, which is now owned by the collection
      Returns:
      the immutable key values collection
    • asImmutable

      public KeyValuesCollection asImmutable()
      Description copied from interface: KeyValuesCollection
      Returns an immutable version of this. May return this if it is immutable. Ensures that the caller can keep around their own immutable version.
      Specified by:
      asImmutable in interface KeyValuesCollection
      Returns:
      an immutable version of this
    • asMap

      public Map<KeyPath,KeyValue> asMap()
      Description copied from interface: KeyValuesCollection
      Return an unmodifiable map representing this collection.

      Note: it is not necessarily the case that this map is immutable. If an immutable map is needed, use asImmutable().asMap().

      Specified by:
      asMap in interface KeyValuesCollection
      Returns:
      the unmodifiable map