/** * Sets or replaces all elements for {@link Project#getPopulations() populations} list. * @param elements An iterable of populations elements * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("populations") @JsonIgnore public final Project.Builder populations(Iterable<? extends Population> elements) { this.populations = ImmutableList.builder(); return addAllPopulations(elements); }
/** * Fill a builder with attribute values from the provided {@code Project} 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 Project.Builder from(Project instance) { Objects.requireNonNull(instance, "instance"); name(instance.getName()); addAllSharedElements(instance.getSharedElements()); addAllUserPaths(instance.getUserPaths()); addAllServers(instance.getServers()); addAllVariables(instance.getVariables()); addAllPopulations(instance.getPopulations()); addAllScenarios(instance.getScenarios()); putAllProjectSettings(instance.getProjectSettings()); return (Project.Builder) this; }