org.infinispan.util
Class InfinispanCollections
java.lang.Object
org.infinispan.util.InfinispanCollections
public class InfinispanCollections
- extends Object
Static helpers for Infinispan-specific collections
- Since:
- 4.0
- Author:
- Manik Surtani
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EMPTY_BIDI_MAP
public static final BidirectionalMap EMPTY_BIDI_MAP
InfinispanCollections
public InfinispanCollections()
emptyReversibleOrderedSet
public static <T> ReversibleOrderedSet<T> emptyReversibleOrderedSet()
emptyBidirectionalMap
public static <K,V> BidirectionalMap<K,V> emptyBidirectionalMap()
transformMapValue
public static <K,V,E> Map<K,V> transformMapValue(Map<K,E> input,
InfinispanCollections.Function<E,V> f)
- Given a map of well known key/value types, it makes a shallow copy of it
while at the same time transforming it's value type to a desired output
type. The transformation of the value type is done using a given a
function.
- Type Parameters:
K
- input map's key typeV
- desired output type of the map's valueE
- input map's value type- Parameters:
input
- contains the input key/value pair mapf
- function instance to use to transform the value part of the map
- Returns:
- a shallow copy of the input Map with all its values transformed.
transformCollectionToMap
public static <K,V,E> Map<K,V> transformCollectionToMap(Collection<E> input,
InfinispanCollections.MapMakerFunction<K,V,E> f)
- Given a collection, transforms the collection to a map given a
InfinispanCollections.MapMakerFunction
- Type Parameters:
K
- output map's key typeV
- output type of the map's valueE
- input collection's entry type- Parameters:
input
- contains a collection of type Ef
- MapMakerFunction instance to use to transform the collection to a key/value pair
- Returns:
- a Map with keys and values generated from the input collection
Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.