/** * @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 ImmutableTxResponse fromJson(Json json) { ImmutableTxResponse.Builder builder = ImmutableTxResponse.builder(); if (json.results != null) { builder.addAllResults(json.results); } if (json.errors != null) { builder.addAllErrors(json.errors); } return builder.build(); }
/** * Creates an immutable copy of a {@link TxResponse} 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 TxResponse instance */ public static ImmutableTxResponse copyOf(TxResponse instance) { if (instance instanceof ImmutableTxResponse) { return (ImmutableTxResponse) instance; } return ImmutableTxResponse.builder() .from(instance) .build(); }