Package net.fortuna.ical4j.model
Interface ContentCollection<T extends Content>
-
- Type Parameters:
T
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ComponentList
,ParameterList
,PropertyList
public interface ContentCollection<T extends Content> extends Serializable
Implementors of this interface support the immutable collection contract specified by this interface. The contract states that any mutation function will not modify the underlying collection, but rather will return a copy of the collection with the applied mutation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ContentCollection<T>
add(T content)
ContentCollection<T>
addAll(Collection<T> content)
default <R extends T>
List<R>get(String... names)
Return a list of elements filtered by name.List<T>
getAll()
default <R extends T>
Optional<R>getFirst(String name)
default <R extends T>
RgetRequired(String name)
ContentCollection<T>
remove(T content)
ContentCollection<T>
removeAll(String... name)
ContentCollection<T>
replace(T content)
-
-
-
Method Detail
-
add
ContentCollection<T> add(T content)
-
addAll
ContentCollection<T> addAll(Collection<T> content)
-
remove
ContentCollection<T> remove(T content)
-
removeAll
ContentCollection<T> removeAll(String... name)
-
replace
ContentCollection<T> replace(T content)
-
get
default <R extends T> List<R> get(String... names)
Return a list of elements filtered by name. If no names are specified return all elements.- Type Parameters:
R
- content type- Parameters:
names
- a list of zero or more names to match- Returns:
- a list of elements less than or equal to the elements in this collection
-
getRequired
default <R extends T> R getRequired(String name) throws ConstraintViolationException
- Throws:
ConstraintViolationException
-
-