diff --git a/src/main/java/net/kemitix/mon/experimental/either/Left.java b/src/main/java/net/kemitix/mon/experimental/either/Left.java index 5de5904..1bfdc88 100644 --- a/src/main/java/net/kemitix/mon/experimental/either/Left.java +++ b/src/main/java/net/kemitix/mon/experimental/either/Left.java @@ -21,7 +21,6 @@ package net.kemitix.mon.experimental.either; -import lombok.Getter; import lombok.RequiredArgsConstructor; import java.util.function.Consumer; @@ -37,13 +36,18 @@ import java.util.function.Function; @RequiredArgsConstructor class Left implements Either { - @Getter - private final boolean left = true; - @Getter - private final boolean right = false; - private final L value; + @Override + public boolean isLeft() { + return true; + } + + @Override + public boolean isRight() { + return false; + } + @Override public void match(final Consumer onLeft, final Consumer onRight) { onLeft.accept(value); diff --git a/src/main/java/net/kemitix/mon/experimental/either/Right.java b/src/main/java/net/kemitix/mon/experimental/either/Right.java index 35f1baf..0085b86 100644 --- a/src/main/java/net/kemitix/mon/experimental/either/Right.java +++ b/src/main/java/net/kemitix/mon/experimental/either/Right.java @@ -21,7 +21,6 @@ package net.kemitix.mon.experimental.either; -import lombok.Getter; import lombok.RequiredArgsConstructor; import java.util.function.Consumer; @@ -37,13 +36,18 @@ import java.util.function.Function; @RequiredArgsConstructor class Right implements Either { - @Getter - private final boolean left = false; - @Getter - private final boolean right = true; - private final R value; + @Override + public boolean isLeft() { + return false; + } + + @Override + public boolean isRight() { + return true; + } + @Override public void match(final Consumer onLeft, final Consumer onRight) { onRight.accept(value);