Deprecate Value.andNot(Supplier)

This commit is contained in:
Paul Campbell 2018-07-28 20:16:44 +01:00
parent 47d3832a14
commit 42b4a7ec7c
3 changed files with 8 additions and 34 deletions

View file

@ -1,6 +1,11 @@
CHANGELOG
=========
0.7.0
-----
* Deprecate `Value.andNot(Supplier)`
0.6.0
-----

View file

@ -188,22 +188,6 @@
#+END_SRC
*** if-not-then-else
#+BEGIN_SRC java
String result;
if (!isTrue()) {
result = TRUE;
} else {
result = FALSE;
}
final String result = Value.<String>whereNot(isTrue())
.then(() -> TRUE)
.otherwise(() -> FALSE);
#+END_SRC
*** if-and-then-else
#+BEGIN_SRC java
@ -221,23 +205,6 @@
#+END_SRC
*** if-and-not-then-else
#+BEGIN_SRC java
String result;
if (isTrue() && !alternativeIsFalse()) {
result = TRUE;
} else {
result = FALSE;
}
final String result = Value.<String>where(isTrue())
.andNot(() -> alternativeIsFalse())
.then(() -> TRUE)
.otherwise(() -> FALSE);
#+END_SRC
*** if-or-then-else
#+BEGIN_SRC java

View file

@ -181,9 +181,11 @@ public interface Value {
*
* @param clause the condition to test
* @return a true or false value clause
* @deprecated use {@link #and(Supplier)}.{@link #not()}
*/
@Deprecated
default ValueClause<T> andNot(final Supplier<Boolean> clause) {
return and(() -> !clause.get());
return and(clause).not();
}
/**