/** * Builds a new {@link ImmutableTxError ImmutableTxError}. * @return An immutable instance of TxError * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableTxError build() { return new ImmutableTxError(opIndex, what); } }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link TxError#opIndex() opIndex} attribute. * @param value The value for opIndex * @return A modified copy of {@code this} object */ public final ImmutableTxError withOpIndex(BigInteger value) { @Nullable BigInteger newValue = Preconditions.checkNotNull(value, "opIndex"); if (this.opIndex == newValue) return this; return new ImmutableTxError(newValue, this.what); }
/** * Copy the current immutable object by setting an optional value for the {@link TxError#opIndex() opIndex} 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 opIndex * @return A modified copy of {@code this} object */ public final ImmutableTxError withOpIndex(Optional<BigInteger> optional) { @Nullable BigInteger value = optional.orElse(null); if (this.opIndex == value) return this; return new ImmutableTxError(value, this.what); }
/** * Copy the current immutable object by setting an optional value for the {@link TxError#what() what} attribute. * An equality check is used on inner nullable value to prevent copying of the same value by returning {@code this}. * @param optional A value for what * @return A modified copy of {@code this} object */ public final ImmutableTxError withWhat(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.what, value)) return this; return new ImmutableTxError(this.opIndex, value); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link TxError#what() what} attribute. * @param value The value for what * @return A modified copy of {@code this} object */ public final ImmutableTxError withWhat(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "what"); if (Objects.equals(this.what, newValue)) return this; return new ImmutableTxError(this.opIndex, newValue); }