Module ical4j.core
Package net.fortuna.ical4j.model
Interface ComponentContainer<C extends Component>
- All Superinterfaces:
ComponentListAccessor<C>
- All Known Subinterfaces:
AlarmsAccessor
,LocationsAccessor
,ParticipantsAccessor
,ResourcesAccessor
- All Known Implementing Classes:
Calendar
,ComponentGroup
,Participant
,VAlarm
,VAvailability
,VEvent
,VFreeBusy
,VJournal
,VTimeZone
,VToDo
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends ComponentContainer<C>>
TAdd a subcomponent to this component.default <T extends ComponentContainer<C>>
TRemove a subcomponent from this component.default <T extends ComponentContainer<C>>
TAdd a subcomponent to this component whilst removing all other subcomponents with the same component name.void
setComponentList
(ComponentList<C> components) default <T extends ComponentContainer<C>>
Twith
(BiFunction<T, C, T> f, C c) A functional method used to apply a component to a container in an undefined way.Methods inherited from interface net.fortuna.ical4j.model.ComponentListAccessor
getComponent, getComponentList, getComponents
-
Method Details
-
setComponentList
-
add
Add a subcomponent to this component.- Parameters:
component
- the subcomponent to add- Returns:
- a reference to this component to support method chaining
-
remove
Remove a subcomponent from this component.- Parameters:
component
- the subcomponent to remove- Returns:
- a reference to this component to support method chaining
-
replace
Add a subcomponent to this component whilst removing all other subcomponents with the same component name.- Parameters:
component
- the subcomponent to add- Returns:
- a reference to the component to support method chaining
-
with
A functional method used to apply a component to a container in an undefined way. For example, a null check can be introduced as follows: container.with((container, component) -> if (component != null) container.add(component); return container;)- Type Parameters:
T
-- Parameters:
f
-c
-- Returns:
-