Interface MutableKeyContainer

All Superinterfaces:
KeyContainer

public interface MutableKeyContainer extends KeyContainer
A mutable version of KeyContainer.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates an empty mutable container.
    <V> @Nullable V
    remove(Key<V> key)
    Removes the value associated with the given key.
    <V> @Nullable V
    set(Key<V> key, V value)
    Sets the value associated with the given key.

    Methods inherited from interface com.xpdustry.distributor.api.key.KeyContainer

    contains, get, getKeys, getOptional, getRequired
  • Method Details

    • create

      static MutableKeyContainer create()
      Creates an empty mutable container.
    • set

      <V> @Nullable V set(Key<V> key, V value)
      Sets the value associated with the given key.
      Type Parameters:
      V - the type of the value
      Parameters:
      key - the key
      value - the value
      Returns:
      the previous value associated with the key, or null if there was none
    • remove

      <V> @Nullable V remove(Key<V> key)
      Removes the value associated with the given key.
      Type Parameters:
      V - the type of the value
      Parameters:
      key - the key
      Returns:
      the previous value associated with the key, or null if there was none