Interface Composite<T,F extends Finder<? extends T>>

All Known Subinterfaces:
SimpleComposite<T>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Composite<T,F extends Finder<? extends T>>
The role of a composite object, that is an object which contains children. They are exposed by means of a Finder.
Author:
Fabrizio Giudici
Status: stable API
Stereotype:
Role
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Class<Composite>
     
    static final Composite<Object,Finder<Object>>
    A default Composite with no children.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the children of this object.
    default void
    forEach(Consumer<? super T> consumer)
    Iterates through children.
    default Stream<? extends T>
    Returns a stream of children.
  • Field Details

  • Method Details

    • findChildren

      @Nonnull F findChildren()
      Returns the children of this object.
      Returns:
      the children
    • stream

      @Nonnull default Stream<? extends T> stream()
      Returns a stream of children.
      Returns:
      the stream
      Since:
      3.2-ALPHA-23
    • forEach

      default void forEach(@Nonnull Consumer<? super T> consumer)
      Iterates through children.
      Parameters:
      consumer - the consumer
      Since:
      3.2-ALPHA-23