Package org.cache2k.configuration
Class DefaultCustomizationCollection<T>
- java.lang.Object
-
- java.util.AbstractCollection<CustomizationSupplier<T>>
-
- org.cache2k.configuration.DefaultCustomizationCollection<T>
-
- All Implemented Interfaces:
Serializable
,Iterable<CustomizationSupplier<T>>
,Collection<CustomizationSupplier<T>>
,CustomizationCollection<T>
public final class DefaultCustomizationCollection<T> extends AbstractCollection<CustomizationSupplier<T>> implements CustomizationCollection<T>
Default implementation for a customization collection using a list.Rationale: Inserting is a little expansive, since we check whether an entry is already existing. Since there are usually only a few entries the list is sufficient.
- Author:
- Jens Wilke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultCustomizationCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(CustomizationSupplier<T> entry)
Adds a customization to the collection.Iterator<CustomizationSupplier<T>>
iterator()
int
size()
String
toString()
-
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface org.cache2k.configuration.CustomizationCollection
addAll
-
-
-
-
Method Detail
-
size
public int size()
- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in classAbstractCollection<CustomizationSupplier<T>>
-
iterator
public Iterator<CustomizationSupplier<T>> iterator()
- Specified by:
iterator
in interfaceCollection<T>
- Specified by:
iterator
in interfaceIterable<T>
- Specified by:
iterator
in classAbstractCollection<CustomizationSupplier<T>>
-
add
public boolean add(CustomizationSupplier<T> entry)
Adds a customization to the collection.- Specified by:
add
in interfaceCollection<T>
- Specified by:
add
in interfaceCustomizationCollection<T>
- Overrides:
add
in classAbstractCollection<CustomizationSupplier<T>>
- Returns:
- always
true
- Throws:
IllegalArgumentException
- if the entry is already existing.
-
toString
public String toString()
- Overrides:
toString
in classAbstractCollection<CustomizationSupplier<T>>
-
-