private CRelease( LocalDate date, Iterable<? extends CItem> items, String ticketSystemID, CVersionType version) { this.date = Objects.requireNonNull(date, "date"); this.items = createUnmodifiableList(false, createSafeList(items, true, false)); this.ticketSystemID = Objects.requireNonNull(ticketSystemID, "ticketSystemID"); this.version = Objects.requireNonNull(version, "version"); }
private CRelease( LocalDate date, Iterable<? extends CItem> items, String ticketSystemID, CVersionType version) { this.date = Objects.requireNonNull(date, "date"); this.items = createUnmodifiableList(false, createSafeList(items, true, false)); this.ticketSystemID = Objects.requireNonNull(ticketSystemID, "ticketSystemID"); this.version = Objects.requireNonNull(version, "version"); }
/** * Copy the current immutable object with elements that replace the content of {@link CReleaseType#items() items}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final CRelease withItems(CItem... elements) { List<CItem> newValue = createUnmodifiableList(false, createSafeList(Arrays.asList(elements), true, false)); return new CRelease(this, this.date, newValue, this.ticketSystemID, this.version); }
/** * Copy the current immutable object with elements that replace the content of {@link CReleaseType#items() items}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final CRelease withItems(CItem... elements) { List<CItem> newValue = createUnmodifiableList(false, createSafeList(Arrays.asList(elements), true, false)); return new CRelease(this, this.date, newValue, this.ticketSystemID, this.version); }
/** * Copy the current immutable object with elements that replace the content of {@link CReleaseType#items() items}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of items elements to set * @return A modified copy of {@code this} object */ public final CRelease withItems(Iterable<? extends CItem> elements) { if (this.items == elements) return this; List<CItem> newValue = createUnmodifiableList(false, createSafeList(elements, true, false)); return new CRelease(this, this.date, newValue, this.ticketSystemID, this.version); }
/** * Copy the current immutable object with elements that replace the content of {@link CReleaseType#items() items}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of items elements to set * @return A modified copy of {@code this} object */ public final CRelease withItems(Iterable<? extends CItem> elements) { if (this.items == elements) return this; List<CItem> newValue = createUnmodifiableList(false, createSafeList(elements, true, false)); return new CRelease(this, this.date, newValue, this.ticketSystemID, this.version); }