From 0a8f34c27c6ef93c5c94d17728af62c7607e225f Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Thu, 3 Dec 2020 19:21:38 -0500 Subject: Rename types to match Java style This renames several interfaces that had names like IWhatever, since that isn't a style that Java uses --- src/main/java/bjc/data/Either.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/main/java/bjc/data/Either.java') diff --git a/src/main/java/bjc/data/Either.java b/src/main/java/bjc/data/Either.java index 0ac3181..e4bc63d 100644 --- a/src/main/java/bjc/data/Either.java +++ b/src/main/java/bjc/data/Either.java @@ -15,7 +15,7 @@ import java.util.function.Function; * The type that could be on the right. * */ -public class Either implements IPair { +public class Either implements Pair { /** * Create a new either with the left value occupied. * @@ -73,16 +73,16 @@ public class Either implements IPair { } @Override - public IPair bind( - final BiFunction> binder) { + public Pair bind( + final BiFunction> binder) { if (binder == null) throw new NullPointerException("Binder must not be null"); return binder.apply(leftVal, rightVal); } @Override - public IPair - bindLeft(final Function> leftBinder) { + public Pair + bindLeft(final Function> leftBinder) { if (leftBinder == null) throw new NullPointerException("Left binder must not be null"); if (isLeft) return leftBinder.apply(leftVal); @@ -90,8 +90,8 @@ public class Either implements IPair { } @Override - public IPair bindRight( - final Function> rightBinder) { + public Pair bindRight( + final Function> rightBinder) { if (rightBinder == null) throw new NullPointerException("Right binder must not be null"); if (isLeft) return new Either<>(leftVal, null); @@ -100,8 +100,8 @@ public class Either implements IPair { @Override public - IPair - combine(final IPair otherPair, + Pair + combine(final Pair otherPair, final BiFunction leftCombiner, final BiFunction rightCombiner) { @@ -129,7 +129,7 @@ public class Either implements IPair { } @Override - public IPair + public Pair mapLeft(final Function mapper) { if (mapper == null) throw new NullPointerException("Mapper must not be null"); @@ -138,7 +138,7 @@ public class Either implements IPair { } @Override - public IPair + public Pair mapRight(final Function mapper) { if (mapper == null) throw new NullPointerException("Mapper must not be null"); -- cgit v1.2.3