Class TypedMap

java.lang.Object
dev.voidframework.core.lang.TypedMap

public final class TypedMap extends Object
Typed key-value map.
  • Constructor Details

    • TypedMap

      public TypedMap()
      Build a new instance.
  • Method Details

    • get

      public <T> T get(TypedMap.Key<T> typedKey)
      Retrieves the value associated to the specified key.
      Type Parameters:
      T - The value type
      Parameters:
      typedKey - The typed key
      Returns:
      The value associated to the specified key, otherwise, null
    • put

      public <T> T put(TypedMap.Key<T> typedKey, T value)
      Associates the specified value with the specified key.
      Type Parameters:
      T - The value type
      Parameters:
      typedKey - The typed key
      value - The value to associate with the given key
      Returns:
      The previous value associated with key, otherwise, null
    • remove

      public <T> T remove(TypedMap.Key<T> typedKey)
      Removes the value associated to the specified key.
      Type Parameters:
      T - The value type
      Parameters:
      typedKey - The typed key
      Returns:
      The value associated to the specified key, otherwise, null
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object