public static final class DataTransactionResult.Builder extends Object implements ResettableBuilder<DataTransactionResult,DataTransactionResult.Builder>
DataTransactionResults. The common
use is for both implementations of DataHolders, and various
ChangeDataHolderEvent.ValueChanges.public DataTransactionResult.Builder result(DataTransactionResult.Type type)
DataTransactionResult.Type to the provided
type. A DataTransactionResult must always have a type to mark
the transaction a "success" or "failure".type - The type of the transaction resultpublic DataTransactionResult.Builder replace(ImmutableValue<?> value)
ImmutableValue to the List of
"replaced" ImmutableValues. The replaced values are always
copied for every DataTransactionResult for referencing. It is
also possible to retrieve these replaced ImmutableValues to
CompositeValueStore.undo(DataTransactionResult) at a later point in
the lifespan of the DataHolder.value - The value to replacepublic DataTransactionResult.Builder replace(Iterable<ImmutableValue<?>> values)
ImmutableValues to the List of
"replaced" ImmutableValues. The replaced values are always
copied for every DataTransactionResult for referencing. It is
also possible to retrieve these replaced ImmutableValues to
CompositeValueStore.undo(DataTransactionResult) at a later point in
the lifespan of the DataHolder.values - The values to replacepublic DataTransactionResult.Builder reject(ImmutableValue<?> value)
ImmutableValue to the List of
"rejected" ImmutableValues. The rejected values are always
copied for every DataTransactionResult for referencing. It is
also possible to retrieve these rejected ImmutableValues to
CompositeValueStore.undo(DataTransactionResult) at a later point in
the lifespan of the DataHolder.value - The values to rejectpublic DataTransactionResult.Builder reject(Iterable<ImmutableValue<?>> values)
ImmutableValues to the List of
"rejected" ImmutableValues. The rejected values are always
copied for every DataTransactionResult for referencing. It is
also possible to retrieve these rejected ImmutableValues to
CompositeValueStore.undo(DataTransactionResult) at a later point in
the lifespan of the DataHolder.values - The values to rejectpublic DataTransactionResult.Builder success(ImmutableValue<?> value)
ImmutableValue to the List of
"successful" ImmutableValues. The successful values are always
copied for every DataTransactionResult for referencing. It is
also possible to retrieve these successful ImmutableValues to
CompositeValueStore.undo(DataTransactionResult) at a later point in
the lifespan of the DataHolder.value - The value that was successfully providedpublic DataTransactionResult.Builder success(Iterable<ImmutableValue<?>> values)
ImmutableValues to the List of
"successful" ImmutableValues. The rejected values are always
copied for every DataTransactionResult for referencing. It is
also possible to retrieve these successful ImmutableValues to
CompositeValueStore.undo(DataTransactionResult) at a later point in
the lifespan of the DataHolder.values - The values that were successfully providedpublic DataTransactionResult.Builder absorbResult(DataTransactionResult result)
DataTransactionResult with the
one provided. Usually, this means that there is some merging of the
ImmutableValues based on Key. If this builder already
has an ImmutableValue as being successfully offered, and the
provided result shows the same key as being rejected, the rejected
ImmutableValue will remain in the final result.result - The result to mergepublic DataTransactionResult build()
DataTransactionResult with the providing
Lists of ImmutableValues that are successfully
offered, ImmutableValues that were replaced, and
ImmutableValues that were rejected.public DataTransactionResult.Builder from(DataTransactionResult value)
ResettableBuilderfrom in interface ResettableBuilder<DataTransactionResult,DataTransactionResult.Builder>value - The built objectpublic DataTransactionResult.Builder reset()
ResettableBuilderreset in interface ResettableBuilder<DataTransactionResult,DataTransactionResult.Builder>