From 3d8ebfeed6a2f30611acbeea79380eae212d9f6f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 19 Sep 2017 23:11:18 +0100 Subject: [PATCH] Mon: make map() and flatMap() final Also remove map() javadoc that is now in Functor. --- src/main/java/net/kemitix/mon/Mon.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/kemitix/mon/Mon.java b/src/main/java/net/kemitix/mon/Mon.java index eff8554..8abe82d 100644 --- a/src/main/java/net/kemitix/mon/Mon.java +++ b/src/main/java/net/kemitix/mon/Mon.java @@ -82,16 +82,8 @@ public class Mon implements Functor { return new Mon<>(v); } - /** - * Applies the function to the value within the Mon, returning a Mon containing the result. - * - * @param f the function to apply - * @param the type of the result of the function - * - * @return a Mon containing the result of the function {@code f} to the value - */ @Override - public Mon map(final Function f) { + public final Mon map(final Function f) { return Mon.of(f.apply(value)); } @@ -104,7 +96,7 @@ public class Mon implements Functor { * * @return a Mon containing the result of the function */ - public Mon flatMap(final Function> f) { + public final Mon flatMap(final Function> f) { return f.apply(value); }