From 42b4a7ec7ccbce5b35e85367cade32c2db327d34 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 28 Jul 2018 20:16:44 +0100 Subject: [PATCH] Deprecate `Value.andNot(Supplier)` --- CHANGELOG | 5 +++ README.org | 33 ------------------- .../java/net/kemitix/conditional/Value.java | 4 ++- 3 files changed, 8 insertions(+), 34 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2d19ccc..9e0efab 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ CHANGELOG ========= +0.7.0 +----- + +* Deprecate `Value.andNot(Supplier)` + 0.6.0 ----- diff --git a/README.org b/README.org index cffa95e..5f293fa 100644 --- a/README.org +++ b/README.org @@ -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.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.where(isTrue()) - .andNot(() -> alternativeIsFalse()) - .then(() -> TRUE) - .otherwise(() -> FALSE); - #+END_SRC - - *** if-or-then-else #+BEGIN_SRC java diff --git a/src/main/java/net/kemitix/conditional/Value.java b/src/main/java/net/kemitix/conditional/Value.java index ca4ddc2..cf8b263 100644 --- a/src/main/java/net/kemitix/conditional/Value.java +++ b/src/main/java/net/kemitix/conditional/Value.java @@ -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 andNot(final Supplier clause) { - return and(() -> !clause.get()); + return and(clause).not(); } /**