com.hazelcast.client.proxy.txn

## Class ClientTxnMultiMapProxy<K,V>

- java.lang.Object
- - com.hazelcast.client.proxy.txn.ClientTxnMultiMapProxy<K,V>

- Type Parameters:
    `K` - key
    `V` - value
  All Implemented Interfaces:
    BaseMultiMap<K,V>, DistributedObject, TransactionalMultiMap<K,V>, TransactionalObject

      public class ClientTxnMultiMapProxy<K,V>
      extends Object
      implements TransactionalMultiMap<K,V>

  Proxy implementation of `TransactionalMultiMap`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientTxnMultiMapProxy(String name, ClientTransactionContext transactionContext)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Destroys this object cluster-wide.
    `Collection<V>` | `get(K key)` Returns the collection of values associated with the key.
    `String` | `getName()` Returns the unique name for this DistributedObject.
    `String` | `getPartitionKey()` Returns the key of the partition that this DistributedObject is assigned to.
    `String` | `getServiceName()` Returns the service name for this object.
    `boolean` | `put(K key, V value)` Stores a key-value pair in the multimap.
    `Collection<V>` | `remove(Object key)` Removes all the entries associated with the given key.
    `boolean` | `remove(Object key, Object value)` Removes the given key value pair from the multimap.
    `int` | `size()` Returns the number of key-value pairs in the multimap.
    `int` | `valueCount(K key)` Returns the number of values matching the given key in the multimap.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.hazelcast.core.DistributedObject

      `destroy, getName, getPartitionKey`

- - ### Constructor Detail

    - #### ClientTxnMultiMapProxy

          public ClientTxnMultiMapProxy(String name,
                                        ClientTransactionContext transactionContext)

  - ### Method Detail

    - #### put

          public boolean put(K key,
                             V value)
                      throws TransactionException

      Description copied from interface: `TransactionalMultiMap`
      Stores a key-value pair in the multimap.
      Specified by:
        `put` in interface `BaseMultiMap<K,V>`
      Specified by:
        `put` in interface `TransactionalMultiMap<K,V>`
      Parameters:
        `key` - the key to be stored
        `value` - the value to be stored
      Returns:
        true if the size of the multimap is increased, false if the multimap already contains the key-value pair.
      Throws:
        `TransactionException`

    - #### get

          public Collection<V> get(K key)

      Description copied from interface: `TransactionalMultiMap`
      Returns the collection of values associated with the key.
      Specified by:
        `get` in interface `BaseMultiMap<K,V>`
      Specified by:
        `get` in interface `TransactionalMultiMap<K,V>`
      Parameters:
        `key` - the key whose associated values are returned
      Returns:
        the collection of the values associated with the key

    - #### remove

          public boolean remove(Object key,
                                Object value)

      Description copied from interface: `TransactionalMultiMap`
      Removes the given key value pair from the multimap.
      Specified by:
        `remove` in interface `BaseMultiMap<K,V>`
      Specified by:
        `remove` in interface `TransactionalMultiMap<K,V>`
      Parameters:
        `key` - the key of the entry to remove
        `value` - the value of the entry to remove
      Returns:
        true if the size of the multimap changed after the remove operation, false otherwise.

    - #### remove

          public Collection<V> remove(Object key)

      Description copied from interface: `TransactionalMultiMap`
      Removes all the entries associated with the given key.
      Specified by:
        `remove` in interface `BaseMultiMap<K,V>`
      Specified by:
        `remove` in interface `TransactionalMultiMap<K,V>`
      Parameters:
        `key` - the key of the entries to remove
      Returns:
        the collection of removed values associated with the given key. The returned collection might be modifiable but it has no effect on the multimap.

    - #### valueCount

          public int valueCount(K key)

      Description copied from interface: `TransactionalMultiMap`
      Returns the number of values matching the given key in the multimap.
      Specified by:
        `valueCount` in interface `BaseMultiMap<K,V>`
      Specified by:
        `valueCount` in interface `TransactionalMultiMap<K,V>`
      Parameters:
        `key` - the key whose number of values is to be returned
      Returns:
        the number of values matching the given key in the multimap

    - #### size

          public int size()

      Description copied from interface: `TransactionalMultiMap`
      Returns the number of key-value pairs in the multimap.
      Specified by:
        `size` in interface `BaseMultiMap<K,V>`
      Specified by:
        `size` in interface `TransactionalMultiMap<K,V>`
      Returns:
        the number of key-value pairs in the multimap

    - #### getServiceName

          public String getServiceName()

      Description copied from interface: `DistributedObject`
      Returns the service name for this object.
      Specified by:
        `getServiceName` in interface `DistributedObject`
      Returns:
        the service name for this object.

    - #### getName

          public String getName()

      Description copied from interface: `DistributedObject`
      Returns the unique name for this DistributedObject. The returned value will never be null. The suggested way for getting name is retrieving it through `DistributedObjectUtil.getName(DistributedObject)` because this might be also a `PrefixedDistributedObject`.
      Specified by:
        `getName` in interface `DistributedObject`
      Returns:
        the unique name for this object.

    - #### getPartitionKey

          public String getPartitionKey()

      Description copied from interface: `DistributedObject`
      Returns the key of the partition that this DistributedObject is assigned to. The returned value only has meaning for a non-partitioned data structure like an `IAtomicLong`. For a partitioned data structure like an `IMap`, the returned value will not be null, but otherwise undefined.
      Specified by:
        `getPartitionKey` in interface `DistributedObject`
      Returns:
        the partition key.

    - #### destroy

          public final void destroy()

      Description copied from interface: `DistributedObject`
      Destroys this object cluster-wide. Clears and releases all resources for this object.
      Specified by:
        `destroy` in interface `DistributedObject`

Copyright © 2018. All rights reserved.