@Test void modifyToShouldThrowOnNullValue() { assertThatThrownBy(() -> ValuePatch.modifyTo(null)).isInstanceOf(NullPointerException.class); }
public static <T> ValuePatch<T> modifyTo(T value) { Preconditions.checkNotNull(value); return new ValuePatch<>(value, State.MODIFY); }
ValuePatch { public static <T> ValuePatch<T> modifyTo(T value) { Preconditions.checkNotNull(value); return new ValuePatch<>(value, State.MODIFY); } }
ValuePatch { public static <T> ValuePatch<T> modifyTo(T value) { Preconditions.checkNotNull(value); return new ValuePatch<>(value, State.MODIFY); } private  ValuePatch(T value, State state); }
ValuePatch { public static <T> ValuePatch<T> modifyTo(T value) { Preconditions.checkNotNull(value); return new ValuePatch<>(value, State.MODIFY); } private  ValuePatch(T value, State state); static ValuePatch<T> modifyTo(T value); static ValuePatch<T> ofNullable(T value); static ValuePatch<T> ofOptional(Optional<T> value); static ValuePatch<T> remove(); static ValuePatch<T> keep(); boolean isRemoved(); boolean isModified(); boolean isKept(); Optional<S> mapNotKeptToOptional(Function<Optional<T>, S> updateTransformation); T get(); Optional<T> notKeptOrElse(Optional<T> replacement); Optional<T> toOptional(); T getOrElse(T replacement); ValuePatch<T> merge(ValuePatch<T> other); @Override boolean equals(Object o); @Override int hashCode(); }
ValuePatch { public static <T> ValuePatch<T> modifyTo(T value) { Preconditions.checkNotNull(value); return new ValuePatch<>(value, State.MODIFY); } private  ValuePatch(T value, State state); static ValuePatch<T> modifyTo(T value); static ValuePatch<T> ofNullable(T value); static ValuePatch<T> ofOptional(Optional<T> value); static ValuePatch<T> remove(); static ValuePatch<T> keep(); boolean isRemoved(); boolean isModified(); boolean isKept(); Optional<S> mapNotKeptToOptional(Function<Optional<T>, S> updateTransformation); T get(); Optional<T> notKeptOrElse(Optional<T> replacement); Optional<T> toOptional(); T getOrElse(T replacement); ValuePatch<T> merge(ValuePatch<T> other); @Override boolean equals(Object o); @Override int hashCode();  }