/** * 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); } }
/** * This instance is equal to all instances of {@code ImmutableTxError} 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 ImmutableTxError && equalTo((ImmutableTxError) another); }
/** * Creates an immutable copy of a {@link TxError} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable TxError instance */ public static ImmutableTxError copyOf(TxError instance) { if (instance instanceof ImmutableTxError) { return (ImmutableTxError) instance; } return ImmutableTxError.builder() .from(instance) .build(); }
/** * @param json A JSON-bindable data structure * @return An immutable value type * @deprecated Do not use this method directly, it exists only for the <em>Jackson</em>-binding infrastructure */ @Deprecated @JsonCreator static ImmutableTxError fromJson(Json json) { ImmutableTxError.Builder builder = ImmutableTxError.builder(); if (json.opIndex != null) { builder.opIndex(json.opIndex); } if (json.what != null) { builder.what(json.what); } return builder.build(); }
/** * 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); }