/** * Adds the provided {@link ImmutableValue}s to the {@link List} of * "successful" {@link ImmutableValue}s. The rejected values are always * copied for every {@link DataTransactionResult} for referencing. It is * also possible to retrieve these successful {@link ImmutableValue}s to * {@link DataHolder#undo(DataTransactionResult)} at a later point in * the lifespan of the {@link DataHolder}. * * @param values The values that were successfully provided * @return This builder, for chaining */ public Builder success(final Iterable<ImmutableValue<?>> values) { for (ImmutableValue<?> value : values) { success(checkNotNull(value)); } return this; }
/** * Adds the provided {@link ImmutableValue}s to the {@link List} of * "successful" {@link ImmutableValue}s. The rejected values are always * copied for every {@link DataTransactionResult} for referencing. It is * also possible to retrieve these successful {@link ImmutableValue}s to * {@link DataHolder#undo(DataTransactionResult)} at a later point in * the lifespan of the {@link DataHolder}. * * @param values The values that were successfully provided * @return This builder, for chaining */ public Builder success(final Iterable<ImmutableValue<?>> values) { for (ImmutableValue<?> value : values) { success(checkNotNull(value)); } return this; }
/** * Creates a new {@link DataTransactionResult} with the provided * {@link ImmutableValue}s being the successful additions and * the provided {@link ImmutableValue}s that were replaced. The result type * is still {@link Type#SUCCESS}. If a {@link Value} * is necessary, use {@link Value#asImmutable()} to use this method. A * {@link DataTransactionResult} is always immutable once created, and any * {@link BaseValue}s should be provided as {@link ImmutableValue}s or * transformed into {@link ImmutableValue}s. * * @param successful The successfully added immutable values * @param replaced The successfully replaced immutable values * @return The new data transaction result */ public static DataTransactionResult successReplaceResult(Collection<ImmutableValue<?>> successful, Collection<ImmutableValue<?>> replaced) { return builder().success(successful).replace(replaced).result(Type.SUCCESS).build(); }
/** * Creates a new {@link DataTransactionResult} with the provided * {@link ImmutableValue} being the successful addition. The result type is * still {@link Type#SUCCESS}. If a {@link Value} is * necessary, use {@link Value#asImmutable()} to use this method. A * {@link DataTransactionResult} is always immutable once created, and any * {@link BaseValue}s should be provided as {@link ImmutableValue}s or * transformed into {@link ImmutableValue}s. * * @param successful The successfully added immutable value * @param replaced The replaced value * @return The new data transaction result */ public static DataTransactionResult successReplaceResult(final ImmutableValue<?> successful, final ImmutableValue<?> replaced) { return builder().result(Type.SUCCESS).success(successful).replace(replaced).build(); }
/** * Creates a new {@link DataTransactionResult} with the provided * {@link ImmutableValue} being the successful addition. The result type is * still {@link Type#SUCCESS}. If a {@link Value} is * necessary, use {@link Value#asImmutable()} to use this method. A * {@link DataTransactionResult} is always immutable once created, and any * {@link BaseValue}s should be provided as {@link ImmutableValue}s or * transformed into {@link ImmutableValue}s. * * @param value The successfully added immutable value * @return The new data transaction result */ public static DataTransactionResult successResult(final ImmutableValue<?> value) { return builder().success(value).result(Type.SUCCESS).build(); }
/** * Creates a new {@link DataTransactionResult} with the provided * {@link ImmutableValue}s being the successful additions and * the provided {@link ImmutableValue}s that were replaced. The result type * is still {@link Type#SUCCESS}. If a {@link Value} * is necessary, use {@link Value#asImmutable()} to use this method. A * {@link DataTransactionResult} is always immutable once created, and any * {@link BaseValue}s should be provided as {@link ImmutableValue}s or * transformed into {@link ImmutableValue}s. * * @param successful The successfully added immutable values * @param replaced The successfully replaced immutable values * @return The new data transaction result */ public static DataTransactionResult successReplaceResult(Collection<ImmutableValue<?>> successful, Collection<ImmutableValue<?>> replaced) { return builder().success(successful).replace(replaced).result(Type.SUCCESS).build(); }
/** * Creates a new {@link DataTransactionResult} with the provided * {@link ImmutableValue} being the successful addition. The result type is * still {@link Type#SUCCESS}. If a {@link Value} is * necessary, use {@link Value#asImmutable()} to use this method. A * {@link DataTransactionResult} is always immutable once created, and any * {@link BaseValue}s should be provided as {@link ImmutableValue}s or * transformed into {@link ImmutableValue}s. * * @param successful The successfully added immutable value * @param replaced The replaced value * @return The new data transaction result */ public static DataTransactionResult successReplaceResult(final ImmutableValue<?> successful, final ImmutableValue<?> replaced) { return builder().result(Type.SUCCESS).success(successful).replace(replaced).build(); }
/** * Creates a new {@link DataTransactionResult} with the provided * {@link ImmutableValue} being the successful addition. The result type is * still {@link Type#SUCCESS}. If a {@link Value} is * necessary, use {@link Value#asImmutable()} to use this method. A * {@link DataTransactionResult} is always immutable once created, and any * {@link BaseValue}s should be provided as {@link ImmutableValue}s or * transformed into {@link ImmutableValue}s. * * @param value The successfully added immutable value * @return The new data transaction result */ public static DataTransactionResult successResult(final ImmutableValue<?> value) { return builder().success(value).result(Type.SUCCESS).build(); }