Class ConvertedMultimap<Key,VInner,VOuter>

java.lang.Object
com.comphenix.protocol.wrappers.collection.AbstractConverted<VInner,VOuter>
com.comphenix.protocol.wrappers.collection.ConvertedMultimap<Key,VInner,VOuter>
Type Parameters:
Key - - the key.
VInner - - the inner value type.
VOuter - - the outer value type.
All Implemented Interfaces:
com.google.common.collect.Multimap<Key,VOuter>

public abstract class ConvertedMultimap<Key,VInner,VOuter> extends AbstractConverted<VInner,VOuter> implements com.google.common.collect.Multimap<Key,VOuter>
Represents a multimap that wraps another multimap by transforming the entries that are going in and out.
  • Constructor Details

    • ConvertedMultimap

      public ConvertedMultimap(com.google.common.collect.Multimap<Key,VInner> inner)
  • Method Details

    • toOuterCollection

      protected Collection<VOuter> toOuterCollection(Collection<VInner> inner)
      Wrap a given collection.
      Parameters:
      inner - - the inner collection.
      Returns:
      The outer collection.
    • toInnerCollection

      protected Collection<VInner> toInnerCollection(Collection<VOuter> outer)
      Wrap a given collection.
      Parameters:
      outer - - the outer collection.
      Returns:
      The inner collection.
    • toInnerObject

      protected Object toInnerObject(Object outer)
      Convert to an inner object if its of the correct type, otherwise leave it.
      Parameters:
      outer - - the outer object.
      Returns:
      The inner object, or the same object.
    • size

      public int size()
      Specified by:
      size in interface com.google.common.collect.Multimap<Key,VInner>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface com.google.common.collect.Multimap<Key,VInner>
    • containsKey

      public boolean containsKey(@Nullable Object key)
      Specified by:
      containsKey in interface com.google.common.collect.Multimap<Key,VInner>
    • containsValue

      public boolean containsValue(@Nullable Object value)
      Specified by:
      containsValue in interface com.google.common.collect.Multimap<Key,VInner>
    • containsEntry

      public boolean containsEntry(@Nullable Object key, @Nullable Object value)
      Specified by:
      containsEntry in interface com.google.common.collect.Multimap<Key,VInner>
    • put

      public boolean put(@Nullable Key key, @Nullable VOuter value)
      Specified by:
      put in interface com.google.common.collect.Multimap<Key,VInner>
    • remove

      public boolean remove(@Nullable Object key, @Nullable Object value)
      Specified by:
      remove in interface com.google.common.collect.Multimap<Key,VInner>
    • putAll

      public boolean putAll(@Nullable Key key, Iterable<? extends VOuter> values)
      Specified by:
      putAll in interface com.google.common.collect.Multimap<Key,VInner>
    • putAll

      public boolean putAll(com.google.common.collect.Multimap<? extends Key,? extends VOuter> multimap)
      Specified by:
      putAll in interface com.google.common.collect.Multimap<Key,VInner>
    • replaceValues

      public Collection<VOuter> replaceValues(@Nullable Key key, Iterable<? extends VOuter> values)
      Specified by:
      replaceValues in interface com.google.common.collect.Multimap<Key,VInner>
    • removeAll

      public Collection<VOuter> removeAll(@Nullable Object key)
      Specified by:
      removeAll in interface com.google.common.collect.Multimap<Key,VInner>
    • clear

      public void clear()
      Specified by:
      clear in interface com.google.common.collect.Multimap<Key,VInner>
    • get

      public Collection<VOuter> get(@Nullable Key key)
      Specified by:
      get in interface com.google.common.collect.Multimap<Key,VInner>
    • keySet

      public Set<Key> keySet()
      Specified by:
      keySet in interface com.google.common.collect.Multimap<Key,VInner>
    • keys

      public com.google.common.collect.Multiset<Key> keys()
      Specified by:
      keys in interface com.google.common.collect.Multimap<Key,VInner>
    • values

      public Collection<VOuter> values()
      Specified by:
      values in interface com.google.common.collect.Multimap<Key,VInner>
    • entries

      public Collection<Map.Entry<Key,VOuter>> entries()
      Specified by:
      entries in interface com.google.common.collect.Multimap<Key,VInner>
    • asMap

      public Map<Key,Collection<VOuter>> asMap()
      Specified by:
      asMap in interface com.google.common.collect.Multimap<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