Class Multimaps.CustomSetMultimap<K,​V>

    • Field Detail

      • factory

        transient Supplier<? extends java.util.Set<V>> factory
    • Constructor Detail

      • CustomSetMultimap

        CustomSetMultimap​(java.util.Map<K,​java.util.Collection<V>> map,
                          Supplier<? extends java.util.Set<V>> factory)
    • Method Detail

      • createCollection

        protected java.util.Set<V> createCollection()
        Description copied from class: AbstractMapBasedMultimap
        Creates the collection of values for a single key.

        Collections with weak, soft, or phantom references are not supported. Each call to createCollection should create a new instance.

        The returned collection class determines whether duplicate key-value pairs are allowed.

        Specified by:
        createCollection in class AbstractSetMultimap<K,​V>
        Returns:
        an empty collection of values
      • wrapCollection

        java.util.Collection<V> wrapCollection​(K key,
                                               java.util.Collection<V> collection)
        Description copied from class: AbstractMapBasedMultimap
        Generates a decorated collection that remains consistent with the values in the multimap for the provided key. Changes to the multimap may alter the returned collection, and vice versa.
        Overrides:
        wrapCollection in class AbstractSetMultimap<K,​V>
      • writeObject

        private void writeObject​(java.io.ObjectOutputStream stream)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • readObject

        private void readObject​(java.io.ObjectInputStream stream)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException