/** * Sets or replaces all mappings from the specified map as entries for the {@link ModuleConfiguration#getOptions() options} map. Nulls are not permitted * @param options The entries that will be added to the options map * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue public final Builder options(Map<String, ? extends Object> options) { this.options = ImmutableMap.builder(); return putAllOptions(options); }
/** * Fill a builder with attribute values from the provided {@code ModuleConfiguration} 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(ModuleConfiguration instance) { Preconditions.checkNotNull(instance, "instance"); name(instance.getName()); addAllIncludePaths(instance.getIncludePaths()); addAllProtoFiles(instance.getProtoFiles()); generator(instance.getGenerator()); output(instance.getOutput()); putAllOptions(instance.getOptions()); return this; }