From 504ca816530efdff06bc202e0432ebd354aec304 Mon Sep 17 00:00:00 2001 From: EVE Date: Tue, 14 Mar 2017 12:07:14 -0400 Subject: Cleanup --- .../src/main/java/bjc/utils/data/IHolder.java | 38 ++++++++++------------ 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java b/BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java index 7b6c8d5..999f3da 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java @@ -1,18 +1,18 @@ package bjc.utils.data; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.UnaryOperator; - import bjc.utils.data.internals.BoundListHolder; import bjc.utils.data.internals.WrappedLazy; import bjc.utils.data.internals.WrappedOption; import bjc.utils.funcdata.FunctionalList; import bjc.utils.funcdata.theory.Functor; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.UnaryOperator; + /** * A holder of a single value. - * + * * @author ben * * @param @@ -21,7 +21,7 @@ import bjc.utils.funcdata.theory.Functor; public interface IHolder extends Functor { /** * Bind a function across the value in this container - * + * * @param * The type of value in this container * @param binder @@ -32,7 +32,7 @@ public interface IHolder extends Functor { /** * Apply an action to the value - * + * * @param action * The action to apply to the value */ @@ -48,10 +48,8 @@ public interface IHolder extends Functor { default Function, Functor> fmap( Function func) { return (argumentFunctor) -> { - if (!(argumentFunctor instanceof IHolder)) { - throw new IllegalArgumentException( - "This functor only supports mapping over instances of IHolder"); - } + if(!(argumentFunctor instanceof IHolder)) throw new IllegalArgumentException( + "This functor only supports mapping over instances of IHolder"); IHolder holder = (IHolder) argumentFunctor; @@ -66,7 +64,7 @@ public interface IHolder extends Functor { /** * Lifts a function to bind over this holder - * + * * @param * The type of the functions return * @param func @@ -77,7 +75,7 @@ public interface IHolder extends Functor { /** * Make this holder lazy - * + * * @return A lazy version of this holder */ public default IHolder makeLazy() { @@ -86,7 +84,7 @@ public interface IHolder extends Functor { /** * Make this holder a list - * + * * @return A list version of this holder */ public default IHolder makeList() { @@ -95,7 +93,7 @@ public interface IHolder extends Functor { /** * Make this holder optional - * + * * @return An optional version of this holder */ public default IHolder makeOptional() { @@ -105,9 +103,9 @@ public interface IHolder extends Functor { /** * Create a new holder with a mapped version of the value in this * holder. - * + * * Does not change the internal state of this holder - * + * * @param * The type of the mapped value * @param mapper @@ -118,7 +116,7 @@ public interface IHolder extends Functor { /** * Replace the held value with a new one - * + * * @param newValue * The value to hold instead * @return The holder itself @@ -131,7 +129,7 @@ public interface IHolder extends Functor { /** * Transform the value held in this holder - * + * * @param transformer * The function to transform the value with * @return The holder itself, for easy chaining @@ -141,7 +139,7 @@ public interface IHolder extends Functor { /** * Unwrap the value contained in this holder so that it is no longer * held - * + * * @param * The type of the unwrapped value * @param unwrapper -- cgit v1.2.3