By default, {@link Aggregate}s have {@linkplain #EMPTY_DEPENDENCIES no dependencies}.
+ * + * @author Laird Nelson + * + * @see #dependencies() + */ +public interface Aggregate { + + + /* + * Static fields. + */ + + + /** + * An immutable, empty {@link SequencedSet} of {@link Assignment}s. + */ + public static final SequencedSetTypically there is no need to override this method.
+ * + * @param r a {@link Function} that retrieves a contextual reference suitable for an {@link AttributedType}; if {@link + * #dependencies()} returns a non-empty {@link SequencedSet} then this argument must not be {@code null} + * + * @return an immutable {@link SequencedSet} of {@link Assignment} instances; never {@code null} + * + * @exception NullPointerException if {@code r} is {@code null} + */ + public default SequencedSet extends Assignment>> assign(final Function super AttributedType, ?> r) { + final Collection extends AttributedElement> ds = this.dependencies(); + if (ds == null || ds.isEmpty()) { + return EMPTY_ASSIGNMENTS; + } + final SequencedSetOptional} if it could not be described.
+ *
+ * @return an {@link Optional} containing a {@link ConstantDesc} describing this {@link AttributedType}, or an
+ * {@linkplain Optional#isEmpty() empty Optional} if it could not be describe; never {@code null}
+ */
+ @Override // Constable
+ public Optional extends ConstantDesc> describeConstable() {
+ return this.element() instanceof Constable e ? e.describeConstable() : Optional.Optional} if it could not be described.
+ *
+ * @return an {@link Optional} containing a {@link ConstantDesc} describing this {@link AttributedType}, or an
+ * {@linkplain Optional#isEmpty() empty Optional} if it could not be describe; never {@code null}
+ */
+ @Override // Constable
+ public Optional extends ConstantDesc> describeConstable() {
+ return this.type() instanceof Constable t ? t.describeConstable() : Optional.Implementations of this method must be idempotent and must return a determinate value.
+ * + *Implementations of this method must not return {@code null}.
+ * + *Implementations of this method should not call {@link #list()}, since that method is typically implemented in + * terms of this one, or undefined behavior may result.
+ * + * @param criteria the criteria to use; may be {@code null} + * + * @return an immutable sublist of this {@link Selectable}'s elements; never {@code null} + * + * @see #list() + */ + // Filters this thing according to the supplied criteria, producing a List. + // List not Stream to permit caching + // List not Collection so equals() is well-defined + // List is unmodifiable and is always valid for the supplied criteria (unenforceable) + // C and not Predicate because equality semantics for Predicate are not well-defined (caching again) + public ListImplementations of this method must be idempotent and must return a determinate value.
+ * + *Implementations of this method must not return {@code null}.
+ * + *The default implementation of this method calls the {@link #select(Object)} method with {@code null} as the sole + * argument.
+ * + * @return an immutable {@link List} of all of this {@link Selectable}'s elements; never {@code null} + * + * @see #select(Object) + */ + public default ListThe cache is unbounded.
+ * + * @paramList}.
+ *
+ * This method is useful primarily for completeness and for testing pathological situations.
+ * + * @paramThere is no guarantee that this method will return new {@link Selectable} instances.
+ * + *The {@link Selectable} instances returned by this method may or may not cache their selections.
+ * + *The selector must (indirectly) designate a sublist from the supplied {@link Collection} as mediated by the + * supplied criteria. The selector must additionally be idempotent and must produce a determinate value when given the + * same arguments.
+ * + *No validation of these semantics of the selector is performed.
+ * + * @param