/** * @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(); }
/** * 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(); }