com.hazelcast.multimap.impl.txn
Class TransactionalMultiMapProxy<K,V>
java.lang.Object
com.hazelcast.spi.AbstractDistributedObject<MultiMapService>
com.hazelcast.multimap.impl.txn.TransactionalMultiMapProxySupport
com.hazelcast.multimap.impl.txn.TransactionalMultiMapProxy<K,V>
- All Implemented Interfaces:
- BaseMultiMap<K,V>, DistributedObject, TransactionalMultiMap<K,V>, TransactionalObject
public class TransactionalMultiMapProxy<K,V>
- extends TransactionalMultiMapProxySupport
- implements TransactionalMultiMap<K,V>
Method Summary |
Collection<V> |
get(K key)
Returns the collection of values associated with the key. |
String |
getName()
Returns the unique name for this DistributedObject. |
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. |
String |
toString()
|
int |
valueCount(K key)
Returns the number of values matching the given key in the multimap. |
Methods inherited from class com.hazelcast.spi.AbstractDistributedObject |
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getPartitionKey, getService, hashCode, invalidate, postDestroy, throwNotActiveException |
TransactionalMultiMapProxy
public TransactionalMultiMapProxy(NodeEngine nodeEngine,
MultiMapService service,
String name,
TransactionSupport tx)
getName
public String getName()
- Description copied from interface:
DistributedObject
- Returns the unique name for this DistributedObject. The returned value will never be null.
- Specified by:
getName
in interface DistributedObject
- Returns:
- the unique name for this object.
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 storedvalue
- 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 removevalue
- 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
toString
public String toString()
- Overrides:
toString
in class AbstractDistributedObject<MultiMapService>
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.