Module ical4j.core

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

public interface ComponentContainer<C extends Component> extends ComponentListAccessor<C>
  • Method Details

    • setComponentList

      void setComponentList(ComponentList<C> components)
    • add

      default <T extends ComponentContainer<C>> T add(C component)
      Add a subcomponent to this component.
      Parameters:
      component - the subcomponent to add
      Returns:
      a reference to this component to support method chaining
    • remove

      default <T extends ComponentContainer<C>> T remove(C component)
      Remove a subcomponent from this component.
      Parameters:
      component - the subcomponent to remove
      Returns:
      a reference to this component to support method chaining
    • replace

      default <T extends ComponentContainer<C>> T replace(C component)
      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

      default <T extends ComponentContainer<C>> T with(BiFunction<T,C,T> f, C c)
      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: