/** * Sets or replaces all elements for {@link TxResponse#errors() errors} list. * @param elements An iterable of errors elements * @return {@code this} builder for use in a chained invocation */ public final Builder errors(Iterable<? extends TxError> elements) { errorsBuilder = ImmutableList.builder(); return addAllErrors(elements); }
/** * @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(); }
/** * Fill a builder with attribute values from the provided {@code TxResponse} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * Collection elements and entries will be added, not replaced. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(TxResponse instance) { Preconditions.checkNotNull(instance, "instance"); addAllResults(instance.results()); addAllErrors(instance.errors()); return this; }