public static final class DataTransactionResult.Builder extends Object implements ResettableBuilder<DataTransactionResult,DataTransactionResult.Builder>
DataTransactionResult
s. The common
use is for both implementations of DataHolder
s, and various
ChangeDataHolderEvent.ValueChange
s.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" ImmutableValue
s. The replaced values are always
copied for every DataTransactionResult
for referencing. It is
also possible to retrieve these replaced ImmutableValue
s 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)
ImmutableValue
s to the List
of
"replaced" ImmutableValue
s. The replaced values are always
copied for every DataTransactionResult
for referencing. It is
also possible to retrieve these replaced ImmutableValue
s 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" ImmutableValue
s. The rejected values are always
copied for every DataTransactionResult
for referencing. It is
also possible to retrieve these rejected ImmutableValue
s 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)
ImmutableValue
s to the List
of
"rejected" ImmutableValue
s. The rejected values are always
copied for every DataTransactionResult
for referencing. It is
also possible to retrieve these rejected ImmutableValue
s 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" ImmutableValue
s. The successful values are always
copied for every DataTransactionResult
for referencing. It is
also possible to retrieve these successful ImmutableValue
s 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)
ImmutableValue
s to the List
of
"successful" ImmutableValue
s. The rejected values are always
copied for every DataTransactionResult
for referencing. It is
also possible to retrieve these successful ImmutableValue
s 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
ImmutableValue
s 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
List
s of ImmutableValue
s that are successfully
offered, ImmutableValue
s that were replaced, and
ImmutableValue
s that were rejected.public DataTransactionResult.Builder from(DataTransactionResult value)
ResettableBuilder
from
in interface ResettableBuilder<DataTransactionResult,DataTransactionResult.Builder>
value
- The built objectpublic DataTransactionResult.Builder reset()
ResettableBuilder
reset
in interface ResettableBuilder<DataTransactionResult,DataTransactionResult.Builder>