Class ORMultiMap<A,​B>

    • Constructor Detail

      • ORMultiMap

        public ORMultiMap​(ORMap<A,​ORSet<B>> underlying,
                          boolean withValueDeltas)
    • Method Detail

      • _empty

        public static ORMultiMap<java.lang.Object,​java.lang.Object> _empty()
      • _emptyWithValueDeltas

        public static ORMultiMap<java.lang.Object,​java.lang.Object> _emptyWithValueDeltas()
      • empty

        public static <A,​B> ORMultiMap<A,​B> empty()
        Provides an empty multimap.
        Returns:
        (undocumented)
      • emptyWithValueDeltas

        public static <A,​B> ORMultiMap<A,​B> emptyWithValueDeltas()
      • apply

        public static ORMultiMap<java.lang.Object,​java.lang.Object> apply()
      • create

        public static <A,​B> ORMultiMap<A,​B> create()
        Java API
        Returns:
        (undocumented)
      • unapply

        public static <A,​B> scala.Option<scala.collection.immutable.Map<A,​scala.collection.immutable.Set<B>>> unapply​(ORMultiMap<A,​B> m)
        Extract the entries().
        Parameters:
        m - (undocumented)
        Returns:
        (undocumented)
      • unapply

        public static <A,​B extends ReplicatedData> scala.Option<scala.collection.immutable.Map<A,​scala.collection.immutable.Set<B>>> unapply​(java.lang.Object value)
        Extract the entries() of an ORMultiMap.
        Parameters:
        value - (undocumented)
        Returns:
        (undocumented)
      • withValueDeltas

        public boolean withValueDeltas()
      • entries

        public scala.collection.immutable.Map<A,​scala.collection.immutable.Set<B>> entries()
        Scala API: All entries of a multimap where keys are strings and values are sets.
        Returns:
        (undocumented)
      • getEntries

        public java.util.Map<A,​java.util.Set<B>> getEntries()
        Java API: All entries of a multimap where keys are strings and values are sets.
        Returns:
        (undocumented)
      • get

        public scala.Option<scala.collection.immutable.Set<B>> get​(A key)
        Get the set associated with the key if there is one.
        Parameters:
        key - (undocumented)
        Returns:
        (undocumented)
      • getOrElse

        public scala.collection.immutable.Set<B> getOrElse​(A key,
                                                           scala.Function0<scala.collection.immutable.Set<B>> default_)
        Scala API: Get the set associated with the key if there is one, else return the given default.
        Parameters:
        key - (undocumented)
        default_ - (undocumented)
        Returns:
        (undocumented)
      • contains

        public boolean contains​(A key)
      • isEmpty

        public boolean isEmpty()
      • size

        public int size()
      • $colon$plus

        public ORMultiMap<A,​B> $colon$plus​(scala.Tuple2<A,​scala.collection.immutable.Set<B>> entry,
                                                 SelfUniqueAddress node)
        Convenience for put. Requires an implicit SelfUniqueAddress.
        Parameters:
        entry - (undocumented)
        node - (undocumented)
        Returns:
        (undocumented)
      • $plus

        public ORMultiMap<A,​B> $plus​(scala.Tuple2<A,​scala.collection.immutable.Set<B>> entry,
                                           Cluster node)
        Deprecated.
        Use `:+` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
      • put

        public ORMultiMap<A,​B> put​(SelfUniqueAddress node,
                                         A key,
                                         scala.collection.immutable.Set<B> value)
        Scala API: Associate an entire set with the key while retaining the history of the previous replicated data set.
        Parameters:
        node - (undocumented)
        key - (undocumented)
        value - (undocumented)
        Returns:
        (undocumented)
      • put

        public ORMultiMap<A,​B> put​(Cluster node,
                                         A key,
                                         scala.collection.immutable.Set<B> value)
        Deprecated.
        Use `put` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
      • put

        public ORMultiMap<A,​B> put​(SelfUniqueAddress node,
                                         A key,
                                         java.util.Set<B> value)
        Java API: Associate an entire set with the key while retaining the history of the previous replicated data set.
        Parameters:
        node - (undocumented)
        key - (undocumented)
        value - (undocumented)
        Returns:
        (undocumented)
      • put

        public ORMultiMap<A,​B> put​(Cluster node,
                                         A key,
                                         java.util.Set<B> value)
        Deprecated.
        Use `put` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
      • put

        public ORMultiMap<A,​B> put​(UniqueAddress node,
                                         A key,
                                         scala.collection.immutable.Set<B> value)
        INTERNAL API
        Parameters:
        node - (undocumented)
        key - (undocumented)
        value - (undocumented)
        Returns:
        (undocumented)
      • remove

        public ORMultiMap<A,​B> remove​(A key,
                                            SelfUniqueAddress node)
        Scala API Remove an entire set associated with the key.
        Parameters:
        key - (undocumented)
        node - (undocumented)
        Returns:
        (undocumented)
      • $minus

        public ORMultiMap<A,​B> $minus​(A key,
                                            Cluster node)
        Deprecated.
        Use `remove` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
        Convenience for remove. Requires an implicit Cluster.
        Parameters:
        key - (undocumented)
        node - (undocumented)
        Returns:
        (undocumented)
      • remove

        public ORMultiMap<A,​B> remove​(SelfUniqueAddress node,
                                            A key)
        Java API Remove an entire set associated with the key.
        Parameters:
        node - (undocumented)
        key - (undocumented)
        Returns:
        (undocumented)
      • remove

        public ORMultiMap<A,​B> remove​(Cluster node,
                                            A key)
        Deprecated.
        Use `remove` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
      • remove

        public ORMultiMap<A,​B> remove​(UniqueAddress node,
                                            A key)
        INTERNAL API
        Parameters:
        node - (undocumented)
        key - (undocumented)
        Returns:
        (undocumented)
      • addBinding

        public ORMultiMap<A,​B> addBinding​(SelfUniqueAddress node,
                                                A key,
                                                B element)
        Add an element to a set associated with a key. If there is no existing set then one will be initialised. TODO add implicit after deprecated is EOL.
        Parameters:
        node - (undocumented)
        key - (undocumented)
        element - (undocumented)
        Returns:
        (undocumented)
      • addBinding

        public ORMultiMap<A,​B> addBinding​(A key,
                                                B element,
                                                Cluster node)
        Deprecated.
        Use `addBinding` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
      • addBinding

        public ORMultiMap<A,​B> addBinding​(Cluster node,
                                                A key,
                                                B element)
        Deprecated.
        Use `addBinding` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
      • addBinding

        public ORMultiMap<A,​B> addBinding​(UniqueAddress node,
                                                A key,
                                                B element)
        INTERNAL API
        Parameters:
        node - (undocumented)
        key - (undocumented)
        element - (undocumented)
        Returns:
        (undocumented)
      • removeBinding

        public ORMultiMap<A,​B> removeBinding​(SelfUniqueAddress node,
                                                   A key,
                                                   B element)
        Remove an element of a set associated with a key. If there are no more elements in the set then the entire set will be removed. TODO add implicit after deprecated is EOL.
        Parameters:
        node - (undocumented)
        key - (undocumented)
        element - (undocumented)
        Returns:
        (undocumented)
      • removeBinding

        public ORMultiMap<A,​B> removeBinding​(A key,
                                                   B element,
                                                   Cluster node)
        Deprecated.
        Use `removeBinding` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
      • removeBinding

        public ORMultiMap<A,​B> removeBinding​(Cluster node,
                                                   A key,
                                                   B element)
        Deprecated.
        Use `removeBinding` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
      • removeBinding

        public ORMultiMap<A,​B> removeBinding​(UniqueAddress node,
                                                   A key,
                                                   B element)
        INTERNAL API
        Parameters:
        node - (undocumented)
        key - (undocumented)
        element - (undocumented)
        Returns:
        (undocumented)
      • replaceBinding

        public ORMultiMap<A,​B> replaceBinding​(SelfUniqueAddress node,
                                                    A key,
                                                    B oldElement,
                                                    B newElement)
        Replace an element of a set associated with a key with a new one if it is different. This is useful when an element is removed and another one is added within the same Update. The order of addition and removal is important in order to retain history for replicated data.
        Parameters:
        node - (undocumented)
        key - (undocumented)
        oldElement - (undocumented)
        newElement - (undocumented)
        Returns:
        (undocumented)
      • replaceBinding

        public ORMultiMap<A,​B> replaceBinding​(A key,
                                                    B oldElement,
                                                    B newElement,
                                                    Cluster node)
        Deprecated.
        Use `replaceBinding` that takes a `SelfUniqueAddress` parameter instead. Since 2.5.20.
      • replaceBinding

        public ORMultiMap<A,​B> replaceBinding​(UniqueAddress node,
                                                    A key,
                                                    B oldElement,
                                                    B newElement)
        INTERNAL API
        Parameters:
        node - (undocumented)
        key - (undocumented)
        oldElement - (undocumented)
        newElement - (undocumented)
        Returns:
        (undocumented)
      • resetDelta

        public ORMultiMap<A,​B> resetDelta()
        Description copied from interface: DeltaReplicatedData
        Reset collection of deltas from mutator operations. When the Replicator invokes the modify function of the Update message the delta is always "reset" and when the user code is invoking one or more mutator operations the data is collecting the delta of the operations and makes it available for the Replicator with the DeltaReplicatedData.delta() accessor. When the Replicator has grabbed the delta it will invoke this method to get a clean data instance without the delta.
        Specified by:
        resetDelta in interface DeltaReplicatedData
        Returns:
        (undocumented)
      • delta

        public scala.Option<ORMap.DeltaOp> delta()
        Description copied from interface: DeltaReplicatedData
        The accumulated delta of mutator operations since previous DeltaReplicatedData.resetDelta(). When the Replicator invokes the modify function of the Update message and the user code is invoking one or more mutator operations the data is collecting the delta of the operations and makes it available for the Replicator with the DeltaReplicatedData.delta() accessor. The modify function shall still return the full state in the same way as ReplicatedData without support for deltas.
        Specified by:
        delta in interface DeltaReplicatedData
        Returns:
        (undocumented)
      • needPruningFrom

        public boolean needPruningFrom​(UniqueAddress removedNode)
        Description copied from interface: RemovedNodePruning
        Does it have any state changes from a specific node, which has been removed from the cluster.
        Specified by:
        needPruningFrom in interface RemovedNodePruning
        Parameters:
        removedNode - (undocumented)
        Returns:
        (undocumented)
      • prune

        public ORMultiMap<A,​B> prune​(UniqueAddress removedNode,
                                           UniqueAddress collapseInto)
        Description copied from interface: RemovedNodePruning
        When the removed node has been removed from the cluster the state changes from that node will be pruned by collapsing the data entries to another node.
        Specified by:
        prune in interface RemovedNodePruning
        Parameters:
        removedNode - (undocumented)
        collapseInto - (undocumented)
        Returns:
        (undocumented)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object