From dca8e9f586fd595a7995f07788318fb92b8cce79 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 28 Jul 2016 16:44:36 -0400 Subject: Format/Cleanup pass --- BJC-Utils2/src/main/java/bjc/utils/data/Pair.java | 51 +++++++++++------------ 1 file changed, 25 insertions(+), 26 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 1fc0d19..1000fc0 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/Pair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/Pair.java @@ -70,24 +70,19 @@ public class Pair } @Override - public MergedType - merge(BiFunction merger) { - if (merger == null) { - throw new NullPointerException("Merger must not be null"); - } - - return merger.apply(leftValue, rightValue); - } - - @Override - public String toString() { - return "pair[l=" + leftValue.toString() + ", r=" - + rightValue.toString() + "]"; + public IPair combine( + IPair otherPair, + BiFunction leftCombiner, + BiFunction rightCombiner) { + return otherPair.bind((otherLeft, otherRight) -> { + return new Pair<>(leftCombiner.apply(leftValue, otherLeft), + rightCombiner.apply(rightValue, otherRight)); + }); } @Override - public IPair - mapLeft(Function mapper) { + public IPair mapLeft( + Function mapper) { if (mapper == null) { throw new NullPointerException("Mapper must not be null"); } @@ -96,8 +91,8 @@ public class Pair } @Override - public IPair - mapRight(Function mapper) { + public IPair mapRight( + Function mapper) { if (mapper == null) { throw new NullPointerException("Mapper must not be null"); } @@ -106,14 +101,18 @@ public class Pair } @Override - public - IPair - combine(IPair otherPair, - BiFunction leftCombiner, - BiFunction rightCombiner) { - return otherPair.bind((otherLeft, otherRight) -> { - return new Pair<>(leftCombiner.apply(leftValue, otherLeft), - rightCombiner.apply(rightValue, otherRight)); - }); + public MergedType merge( + BiFunction merger) { + if (merger == null) { + throw new NullPointerException("Merger must not be null"); + } + + return merger.apply(leftValue, rightValue); + } + + @Override + public String toString() { + return "pair[l=" + leftValue.toString() + ", r=" + + rightValue.toString() + "]"; } } \ No newline at end of file -- cgit v1.2.3