Class ConvertedMap<Key,VInner,VOuter>

java.lang.Object
com.comphenix.protocol.wrappers.collection.AbstractConverted<VInner,VOuter>
com.comphenix.protocol.wrappers.collection.ConvertedMap<Key,VInner,VOuter>
Type Parameters:
VInner - - type of the value in the entries in the inner invisible map.
VOuter - - type of the value in the entries publically accessible in the outer map.
All Implemented Interfaces:
Map<Key,VOuter>

public abstract class ConvertedMap<Key,VInner,VOuter> extends AbstractConverted<VInner,VOuter> implements Map<Key,VOuter>
Represents a map that wraps another map by transforming the entries going in and out.
  • Constructor Details

  • Method Details

    • clear

      public void clear()
      Specified by:
      clear in interface Map<Key,VInner>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<Key,VInner>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<Key,VInner>
    • entrySet

      public Set<Map.Entry<Key,VOuter>> entrySet()
      Specified by:
      entrySet in interface Map<Key,VInner>
    • toOuter

      protected VOuter toOuter(Key key, VInner inner)
      Convert a value from the inner map to the outer visible map.
      Parameters:
      key - - unused value.
      inner - - the inner value.
      Returns:
      The outer value.
    • toInner

      protected VInner toInner(Key key, VOuter outer)
      Convert a value from the outer map to the internal inner map.
      Parameters:
      key - - unused value.
      outer - - the outer value.
      Returns:
      The inner value.
    • get

      public VOuter get(Object key)
      Specified by:
      get in interface Map<Key,VInner>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<Key,VInner>
    • keySet

      public Set<Key> keySet()
      Specified by:
      keySet in interface Map<Key,VInner>
    • put

      public VOuter put(Key key, VOuter value)
      Specified by:
      put in interface Map<Key,VInner>
    • putAll

      public void putAll(Map<? extends Key,? extends VOuter> m)
      Specified by:
      putAll in interface Map<Key,VInner>
    • remove

      public VOuter remove(Object key)
      Specified by:
      remove in interface Map<Key,VInner>
    • size

      public int size()
      Specified by:
      size in interface Map<Key,VInner>
    • values

      public Collection<VOuter> values()
      Specified by:
      values in interface Map<Key,VInner>
    • toString

      public String toString()
      Returns a string representation of this map. The string representation consists of a list of key-value mappings in the order returned by the map's entrySet view's iterator, enclosed in braces ("{}"). Adjacent mappings are separated by the characters ", " (comma and space). Each key-value mapping is rendered as the key followed by an equals sign ("=") followed by the associated value. Keys and values are converted to strings as by String.valueOf(Object).
      Overrides:
      toString in class Object
      Returns:
      a string representation of this map