/** * Construct a new immutable {@code CChangelog} instance. * @param project The value for the {@code project} attribute * @param releases The value for the {@code releases} attribute * @param ticketSystems The value for the {@code ticketSystems} attribute * @return An immutable CChangelog instance */ public static CChangelog of(String project, Iterable<? extends CRelease> releases, Map<String, ? extends URI> ticketSystems) { return new CChangelog(project, releases, ticketSystems); }
/** * Construct a new immutable {@code CChangelog} instance. * @param project The value for the {@code project} attribute * @param releases The value for the {@code releases} attribute * @param ticketSystems The value for the {@code ticketSystems} attribute * @return An immutable CChangelog instance */ public static CChangelog of(String project, Iterable<? extends CRelease> releases, Map<String, ? extends URI> ticketSystems) { return new CChangelog(project, releases, ticketSystems); }
/** * Copy the current immutable object by setting a value for the {@link CChangelogType#project() project} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for project * @return A modified copy of the {@code this} object */ public final CChangelog withProject(String value) { if (this.project.equals(value)) return this; String newValue = Objects.requireNonNull(value, "project"); return new CChangelog(this, newValue, this.releases, this.ticketSystems); }
/** * Copy the current immutable object by setting a value for the {@link CChangelogType#project() project} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for project * @return A modified copy of the {@code this} object */ public final CChangelog withProject(String value) { if (this.project.equals(value)) return this; String newValue = Objects.requireNonNull(value, "project"); return new CChangelog(this, newValue, this.releases, this.ticketSystems); }
/** * Copy the current immutable object by replacing the {@link CChangelogType#ticketSystems() ticketSystems} map with the specified map. * Nulls are not permitted as keys or values. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param entries The entries to be added to the ticketSystems map * @return A modified copy of {@code this} object */ public final CChangelog withTicketSystems(Map<String, ? extends URI> entries) { if (this.ticketSystems == entries) return this; Map<String, URI> newValue = createUnmodifiableMap(true, false, entries); return new CChangelog(this, this.project, this.releases, newValue); }
/** * Copy the current immutable object by replacing the {@link CChangelogType#ticketSystems() ticketSystems} map with the specified map. * Nulls are not permitted as keys or values. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param entries The entries to be added to the ticketSystems map * @return A modified copy of {@code this} object */ public final CChangelog withTicketSystems(Map<String, ? extends URI> entries) { if (this.ticketSystems == entries) return this; Map<String, URI> newValue = createUnmodifiableMap(true, false, entries); return new CChangelog(this, this.project, this.releases, newValue); }
/** * Builds a new {@link CChangelog CChangelog}. * @return An immutable instance of CChangelog * @throws java.lang.IllegalStateException if any required attributes are missing */ public CChangelog build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new CChangelog( null, project, createUnmodifiableList(true, releases), createUnmodifiableMap(false, false, ticketSystems)); }
/** * Builds a new {@link CChangelog CChangelog}. * @return An immutable instance of CChangelog * @throws java.lang.IllegalStateException if any required attributes are missing */ public CChangelog build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new CChangelog( null, project, createUnmodifiableList(true, releases), createUnmodifiableMap(false, false, ticketSystems)); }
/** * Copy the current immutable object with elements that replace the content of {@link CChangelogType#releases() releases}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final CChangelog withReleases(CRelease... elements) { List<CRelease> newValue = createUnmodifiableList(false, createSafeList(Arrays.asList(elements), true, false)); return new CChangelog(this, this.project, newValue, this.ticketSystems); }
/** * Copy the current immutable object with elements that replace the content of {@link CChangelogType#releases() releases}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final CChangelog withReleases(CRelease... elements) { List<CRelease> newValue = createUnmodifiableList(false, createSafeList(Arrays.asList(elements), true, false)); return new CChangelog(this, this.project, newValue, this.ticketSystems); }
/** * Copy the current immutable object with elements that replace the content of {@link CChangelogType#releases() releases}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of releases elements to set * @return A modified copy of {@code this} object */ public final CChangelog withReleases(Iterable<? extends CRelease> elements) { if (this.releases == elements) return this; List<CRelease> newValue = createUnmodifiableList(false, createSafeList(elements, true, false)); return new CChangelog(this, this.project, newValue, this.ticketSystems); }
/** * Copy the current immutable object with elements that replace the content of {@link CChangelogType#releases() releases}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of releases elements to set * @return A modified copy of {@code this} object */ public final CChangelog withReleases(Iterable<? extends CRelease> elements) { if (this.releases == elements) return this; List<CRelease> newValue = createUnmodifiableList(false, createSafeList(elements, true, false)); return new CChangelog(this, this.project, newValue, this.ticketSystems); }