From 504ca816530efdff06bc202e0432ebd354aec304 Mon Sep 17 00:00:00 2001 From: EVE Date: Tue, 14 Mar 2017 12:07:14 -0400 Subject: Cleanup --- BJC-Utils2/src/main/java/bjc/utils/data/Pair.java | 28 +++++++---------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/Pair.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/Pair.java b/BJC-Utils2/src/main/java/bjc/utils/data/Pair.java index b22fd28..77afa4a 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/Pair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/Pair.java @@ -5,7 +5,7 @@ import java.util.function.Function; /** * A pair of values, with nothing special about them. - * + * * @author ben * * @param @@ -29,7 +29,7 @@ public class Pair implements IPair { /** * Create a new pair with both sides set to the specified values - * + * * @param left * The value of the left side * @param right @@ -43,9 +43,7 @@ public class Pair implements IPair { @Override public IPair bind( BiFunction> binder) { - if (binder == null) { - throw new NullPointerException("Binder must not be null."); - } + if(binder == null) throw new NullPointerException("Binder must not be null."); return binder.apply(leftValue, rightValue); } @@ -53,9 +51,7 @@ public class Pair implements IPair { @Override public IPair bindLeft( Function> leftBinder) { - if (leftBinder == null) { - throw new NullPointerException("Binder must not be null"); - } + if(leftBinder == null) throw new NullPointerException("Binder must not be null"); return leftBinder.apply(leftValue); } @@ -63,9 +59,7 @@ public class Pair implements IPair { @Override public IPair bindRight( Function> rightBinder) { - if (rightBinder == null) { - throw new NullPointerException("Binder must not be null"); - } + if(rightBinder == null) throw new NullPointerException("Binder must not be null"); return rightBinder.apply(rightValue); } @@ -83,27 +77,21 @@ public class Pair implements IPair { @Override public IPair mapLeft(Function mapper) { - if (mapper == null) { - throw new NullPointerException("Mapper must not be null"); - } + if(mapper == null) throw new NullPointerException("Mapper must not be null"); return new Pair<>(mapper.apply(leftValue), rightValue); } @Override public IPair mapRight(Function mapper) { - if (mapper == null) { - throw new NullPointerException("Mapper must not be null"); - } + if(mapper == null) throw new NullPointerException("Mapper must not be null"); return new Pair<>(leftValue, mapper.apply(rightValue)); } @Override public MergedType merge(BiFunction merger) { - if (merger == null) { - throw new NullPointerException("Merger must not be null"); - } + if(merger == null) throw new NullPointerException("Merger must not be null"); return merger.apply(leftValue, rightValue); } -- cgit v1.2.3