/** * Copy the current immutable object by setting a value for the {@link RawMetrics#getMessages() messages} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for messages * @return A modified copy of the {@code this} object */ public final ImmutableRawMetrics withMessages(Long value) { if (this.messages.equals(value)) return this; Long newValue = Objects.requireNonNull(value, "messages"); return new ImmutableRawMetrics( this.integrationId, this.version, this.pod, newValue, this.errors, this.startDate, this.resetDate, this.lastProcessed); }
/** * This instance is equal to all instances of {@code ImmutableRawMetrics} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(@Nullable Object another) { if (this == another) return true; return another instanceof ImmutableRawMetrics && equalTo((ImmutableRawMetrics) another); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link RawMetrics#getStartDate() startDate} attribute. * @param value The value for startDate * @return A modified copy of {@code this} object */ public final ImmutableRawMetrics withStartDate(Date value) { @Nullable Date newValue = Objects.requireNonNull(value, "startDate"); if (this.startDate == newValue) return this; return new ImmutableRawMetrics( this.integrationId, this.version, this.pod, this.messages, this.errors, newValue, this.resetDate, this.lastProcessed); }
/** * Copy the current immutable object by setting an optional value for the {@link RawMetrics#getResetDate() resetDate} attribute. * A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning {@code this}. * @param optional A value for resetDate * @return A modified copy of {@code this} object */ public final ImmutableRawMetrics withResetDate(Optional<? extends Date> optional) { @Nullable Date value = optional.orElse(null); if (this.resetDate == value) return this; return new ImmutableRawMetrics( this.integrationId, this.version, this.pod, this.messages, this.errors, this.startDate, value, this.lastProcessed); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link RawMetrics#getLastProcessed() lastProcessed} attribute. * @param value The value for lastProcessed * @return A modified copy of {@code this} object */ public final ImmutableRawMetrics withLastProcessed(Date value) { @Nullable Date newValue = Objects.requireNonNull(value, "lastProcessed"); if (this.lastProcessed == newValue) return this; return new ImmutableRawMetrics( this.integrationId, this.version, this.pod, this.messages, this.errors, this.startDate, this.resetDate, newValue); }
/** * Copy the current immutable object by setting a value for the {@link RawMetrics#getPod() pod} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for pod * @return A modified copy of the {@code this} object */ public final ImmutableRawMetrics withPod(String value) { if (this.pod.equals(value)) return this; String newValue = Objects.requireNonNull(value, "pod"); return new ImmutableRawMetrics( this.integrationId, this.version, newValue, this.messages, this.errors, this.startDate, this.resetDate, this.lastProcessed); }
/** * Copy the current immutable object by setting an optional value for the {@link RawMetrics#getStartDate() startDate} attribute. * A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning {@code this}. * @param optional A value for startDate * @return A modified copy of {@code this} object */ public final ImmutableRawMetrics withStartDate(Optional<? extends Date> optional) { @Nullable Date value = optional.orElse(null); if (this.startDate == value) return this; return new ImmutableRawMetrics( this.integrationId, this.version, this.pod, this.messages, this.errors, value, this.resetDate, this.lastProcessed); }
/** * Copy the current immutable object by setting a value for the {@link RawMetrics#getVersion() version} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for version * @return A modified copy of the {@code this} object */ public final ImmutableRawMetrics withVersion(String value) { if (this.version.equals(value)) return this; String newValue = Objects.requireNonNull(value, "version"); return new ImmutableRawMetrics( this.integrationId, newValue, this.pod, this.messages, this.errors, this.startDate, this.resetDate, this.lastProcessed); }
/** * Copy the current immutable object by setting a value for the {@link RawMetrics#getErrors() errors} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for errors * @return A modified copy of the {@code this} object */ public final ImmutableRawMetrics withErrors(Long value) { if (this.errors.equals(value)) return this; Long newValue = Objects.requireNonNull(value, "errors"); return new ImmutableRawMetrics( this.integrationId, this.version, this.pod, this.messages, newValue, this.startDate, this.resetDate, this.lastProcessed); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link RawMetrics#getResetDate() resetDate} attribute. * @param value The value for resetDate * @return A modified copy of {@code this} object */ public final ImmutableRawMetrics withResetDate(Date value) { @Nullable Date newValue = Objects.requireNonNull(value, "resetDate"); if (this.resetDate == newValue) return this; return new ImmutableRawMetrics( this.integrationId, this.version, this.pod, this.messages, this.errors, this.startDate, newValue, this.lastProcessed); }
/** * Copy the current immutable object by setting a value for the {@link RawMetrics#getIntegrationId() integrationId} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for integrationId * @return A modified copy of the {@code this} object */ public final ImmutableRawMetrics withIntegrationId(String value) { if (this.integrationId.equals(value)) return this; String newValue = Objects.requireNonNull(value, "integrationId"); return new ImmutableRawMetrics( newValue, this.version, this.pod, this.messages, this.errors, this.startDate, this.resetDate, this.lastProcessed); }
/** * Copy the current immutable object by setting an optional value for the {@link RawMetrics#getLastProcessed() lastProcessed} attribute. * A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning {@code this}. * @param optional A value for lastProcessed * @return A modified copy of {@code this} object */ public final ImmutableRawMetrics withLastProcessed(Optional<? extends Date> optional) { @Nullable Date value = optional.orElse(null); if (this.lastProcessed == value) return this; return new ImmutableRawMetrics( this.integrationId, this.version, this.pod, this.messages, this.errors, this.startDate, this.resetDate, value); }
/** * Builds a new {@link ImmutableRawMetrics ImmutableRawMetrics}. * @return An immutable instance of RawMetrics * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableRawMetrics build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableRawMetrics(integrationId, version, pod, messages, errors, startDate, resetDate, lastProcessed); }