public class ImmutableMetaCollection<S> extends Object implements MetaCollection<S>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the meta collection of meta values
|
<T extends Meta<S>> |
contains(Class<T> cls)
Obtains whether a mapping of the type provided exists within the collection
|
static <T extends MetaOwner> |
copyOf(MetaCollection<T> collection) |
<T extends Meta<S>> |
get(Class<T> cls)
Obtains the metadata value from the component type specified
|
void |
iterate(java.util.function.Consumer<Map.Entry<Class<? extends Meta<S>>,Meta<S>>> consumer)
Iterates the collection
|
<T extends Meta<S>> |
put(Class<T> cls,
T meta)
Puts a mapping of a meta class and the meta value into the collection, replacing the existing
value if necessary
|
<T extends Meta<S>> |
put(T meta)
Puts the meta value into the collection, inferring the type
|
<T extends Meta<S>> |
putIfAbsent(Class<T> cls,
T meta)
Appends the meta mapping only if it does not already exist as defined by
MetaCollection.contains(Class) . |
<T extends Meta<S>> |
putIfAbsent(T meta)
Puts the meta value into the collection if it does not exist as defined by
MetaCollection.contains(Class) |
<T extends Meta<S>> |
remove(Class<T> cls)
Removes the meta tag from this collection
|
public static <T extends MetaOwner> MetaCollection<T> copyOf(MetaCollection<T> collection)
public <T extends Meta<S>> T get(Class<T> cls)
MetaCollection
get
in interface MetaCollection<S>
T
- the meta value typecls
- the component typepublic <T extends Meta<S>> void put(T meta)
MetaCollection
put
in interface MetaCollection<S>
T
- the meta typemeta
- the meta to putpublic <T extends Meta<S>> boolean putIfAbsent(T meta)
MetaCollection
MetaCollection.contains(Class)
putIfAbsent
in interface MetaCollection<S>
T
- the meta typemeta
- the meta value to puttrue
if the operation changed the collection, false
if it had no effectpublic <T extends Meta<S>> void put(Class<T> cls, T meta)
MetaCollection
put
in interface MetaCollection<S>
T
- the meta value typecls
- the meta typemeta
- the meta valuepublic <T extends Meta<S>> boolean putIfAbsent(Class<T> cls, T meta)
MetaCollection
MetaCollection.contains(Class)
.
Otherwise has no effect.putIfAbsent
in interface MetaCollection<S>
T
- the meta value typecls
- the meta typemeta
- the meta valuetrue
if this operation changed the collection, false
if it had no effectpublic <T extends Meta<S>> boolean contains(Class<T> cls)
MetaCollection
contains
in interface MetaCollection<S>
T
- the meta value typecls
- the meta typetrue
if it exists, false
if it doesn'tpublic <T extends Meta<S>> T remove(Class<T> cls)
MetaCollection
remove
in interface MetaCollection<S>
T
- the meta value typecls
- the meta type to removenull
if this operation had no effectpublic void iterate(java.util.function.Consumer<Map.Entry<Class<? extends Meta<S>>,Meta<S>>> consumer)
MetaCollection
iterate
in interface MetaCollection<S>
consumer
- the iteration functionpublic void clear()
MetaCollection
clear
in interface MetaCollection<S>
Copyright © 2016. All rights reserved.