Interface Aggregate<T>

All Known Implementing Classes:
PresentationModelAggregate
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 Aggregate<T>
The role of an aggregate object, that is an object which contains other named objects.
Author:
Fabrizio Giudici
Stereotype:
Role
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Class<Aggregate>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an object given its name.
    default Set<String>
    Returns the names of contained objects.
    static <T> Aggregate<T>
    Returns a new empty instance that will be populated by means of with(String, Object).
    static <T> Aggregate<T>
    of(String name, T value)
    Returns a new instance with the specified (name, value) pair.
    static <T> Aggregate<T>
    of(Map<String,T> mapByName)
    Returns a new instance with the specified (name, value) pairs.
    default Aggregate<T>
    with(String name, T value)
    Returns a new instance with the specified (name, value) pair.
  • Field Details

  • Method Details

    • getByName

      @Nonnull Optional<T> getByName(@Nonnull String name)
      Returns an object given its name.
      Parameters:
      name - the name
      Returns:
      the object
    • getNames

      @Nonnull default Set<String> getNames()
      Returns the names of contained objects.
      Returns:
      the names of the objects
      Since:
      3.1-ALPHA-8
    • of

      @Nonnull static <T> Aggregate<T> of(@Nonnull Map<String,T> mapByName)
      Returns a new instance with the specified (name, value) pairs.
      Type Parameters:
      T - the static type of the value
      Parameters:
      mapByName - the map containing the pairs
      Returns:
      the new instance
      Since:
      3.2-ALPHA-1
    • newInstance

      @Nonnull static <T> Aggregate<T> newInstance()
      Returns a new empty instance that will be populated by means of with(String, Object).
      Type Parameters:
      T - the static type of the aggregate
      Returns:
      the new instance
      Since:
      3.2-ALPHA-2
    • of

      @Nonnull static <T> Aggregate<T> of(@Nonnull String name, @Nonnull T value)
      Returns a new instance with the specified (name, value) pair.
      Type Parameters:
      T - the static type of the aggregate
      Parameters:
      name - the name in the pair
      value - the value in the pair
      Returns:
      the new instance
      Since:
      3.2-ALPHA-1
    • with

      @Nonnull default Aggregate<T> with(@Nonnull String name, @Nonnull T value)
      Returns a new instance with the specified (name, value) pair.
      Parameters:
      name - the name in the pair
      value - the value in the pair
      Returns:
      the new instance
      Since:
      3.2-ALPHA-1