/** * Sets or replaces all elements for {@link Conditions#getConditions() conditions} list. * @param elements An iterable of conditions elements * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder conditions(Iterable<? extends Condition> elements) { this.conditions = ImmutableList.builder(); return addAllConditions(elements); }
/** * Fill a builder with attribute values from the provided {@code Conditions} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * Collection elements and entries will be added, not replaced. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder from(Conditions instance) { Objects.requireNonNull(instance, "instance"); matchType(instance.getMatchType()); addAllConditions(instance.getConditions()); Optional<String> descriptionOptional = instance.getDescription(); if (descriptionOptional.isPresent()) { description(descriptionOptional); } return this; }