public final class ValueCollectionFactory extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Collection<T> |
createCollection(Collection collection)
Creates a same type collection with the given collection depending on the
MultiMapConfig.valueCollectionType . |
static <T> Collection<T> |
createCollection(MultiMapConfig.ValueCollectionType collectionType)
Picks right collection type, like
Set or List
depending on the MultiMapConfig.valueCollectionType and creates it. |
static <T> Collection<T> |
createCollection(MultiMapConfig.ValueCollectionType collectionType,
int initialCapacity)
Picks right collection type, like
Set or List
depending on the MultiMapConfig.valueCollectionType and creates it. |
static <T> Collection<T> |
emptyCollection(MultiMapConfig.ValueCollectionType collectionType)
Picks right empty collection type, like
Collections.emptySet()
or Collections.emptyList() )} depending on the
MultiMapConfig.valueCollectionType |
public static <T> Collection<T> createCollection(MultiMapConfig.ValueCollectionType collectionType)
Set
or List
depending on the MultiMapConfig.valueCollectionType
and creates it.collectionType
- one of MultiMapConfig.ValueCollectionType.SET
or MultiMapConfig.ValueCollectionType.LIST
Set
or List
depending on the collectionType argumentIllegalArgumentException
- if collectionType is unknownpublic static <T> Collection<T> createCollection(Collection collection)
MultiMapConfig.valueCollectionType
.collection
- to be asked to return a new appropriate implementation instance
according to MultiMapConfig.ValueCollectionType
Set
or List
depending on the collectionType argumentIllegalArgumentException
- if collectionType is unknownpublic static <T> Collection<T> createCollection(MultiMapConfig.ValueCollectionType collectionType, int initialCapacity)
Set
or List
depending on the MultiMapConfig.valueCollectionType
and creates it.collectionType
- one of MultiMapConfig.ValueCollectionType.SET
or MultiMapConfig.ValueCollectionType#LIST
initialCapacity
- if smaller than or equals to 0 falls back to default initial capacity of corresponding collection.Set
or List
depending on the collectionType argumentIllegalArgumentException
- if collectionType is unknownpublic static <T> Collection<T> emptyCollection(MultiMapConfig.ValueCollectionType collectionType)
Collections.emptySet()
or Collections.emptyList()
)} depending on the
MultiMapConfig.valueCollectionType
collectionType
- one of MultiMapConfig.ValueCollectionType#SET
or MultiMapConfig.ValueCollectionType#LIST
Collections.emptySet()
depending on the collectionType argumentIllegalArgumentException
- if collectionType is unknownCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.