Interface Aggregate
public interface Aggregate
An object with dependencies.
By default, Aggregates have no dependencies.
- Author:
- Laird Nelson
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SequencedSet<Assignment<?>> An immutable, emptySequencedSetofAssignments.static final SequencedSet<Annotated<Element>> An immutable, emptySequencedSetofElements. -
Method Summary
Modifier and TypeMethodDescriptiondefault SequencedSet<? extends Assignment<?>> assign(Function<? super Annotated<? extends AnnotatedConstruct>, ?> r) A convenience method that assigns a contextual reference to each of thisAggregate'sAnnotated<? extends Element>-typed dependencies and returns the resultingSequencedSetofAssignments.default SequencedSet<? extends Annotated<? extends Element>> Returns an immutable, determinate,SequencedSetofAnnotated<? extends Element>instances.
-
Field Details
-
EMPTY_ASSIGNMENTS
An immutable, emptySequencedSetofAssignments. -
EMPTY_DEPENDENCIES
An immutable, emptySequencedSetofElements.
-
-
Method Details
-
dependencies
Returns an immutable, determinate,SequencedSetofAnnotated<? extends Element>instances.If an
Annotated<? extends Element>in the set represents this veryAggregateimplementation, undefined behavior, including the possibility of infinite loops, may result (anAggregatemay not have itself as a dependency).Note that it is permissible for an
Annotated<? extends Element>in the set to represent another type.The default implementation of this method returns the value of the
EMPTY_DEPENDENCIESfield.- Returns:
- an immutable, determinate,
SequencedSetofAnnotated<? extends Element>instances; nevernull - See Also:
-
assign
default SequencedSet<? extends Assignment<?>> assign(Function<? super Annotated<? extends AnnotatedConstruct>, ?> r) A convenience method that assigns a contextual reference to each of thisAggregate'sAnnotated<? extends Element>-typed dependencies and returns the resultingSequencedSetofAssignments.Note: Undefined behavior may result if an
Annotated<? extends Element>in the dependencies represents thisAggregateimplementation (anAggregatemay not have itself as a dependency).Typically there is no need to override this method.
Usage of this method is not required.
- Parameters:
r- aFunctionthat retrieves a contextual reference suitable for anAnnotated<? extends AnnotatedConstruct>; ifdependencies()returns a non-emptySequencedSetthen this argument must not benull- Returns:
- an immutable
SequencedSetofAssignmentinstances; nevernull - Throws:
NullPointerException- ifrisnull
-