/** * @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(); }
/** * Fill a builder with attribute values from the provided {@code TxError} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(TxError instance) { Preconditions.checkNotNull(instance, "instance"); Optional<BigInteger> opIndexOptional = instance.opIndex(); if (opIndexOptional.isPresent()) { opIndex(opIndexOptional); } Optional<String> whatOptional = instance.what(); if (whatOptional.isPresent()) { what(whatOptional); } return this; }
/** * 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(); }
/** * Creates a builder for {@link ImmutableTxError ImmutableTxError}. * @return A new ImmutableTxError builder */ public static ImmutableTxError.Builder builder() { return new ImmutableTxError.Builder(); }