From 889fac2bdf993dc86f64a8893c0260fdcf848acb Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 10 Apr 2017 16:40:33 -0400 Subject: Cleanup --- .../java/bjc/utils/data/internals/BoundLazy.java | 35 ++++---- .../bjc/utils/data/internals/BoundLazyPair.java | 99 +++++++++++----------- .../bjc/utils/data/internals/BoundListHolder.java | 34 ++++---- .../utils/data/internals/HalfBoundLazyPair.java | 75 ++++++++-------- .../java/bjc/utils/data/internals/WrappedLazy.java | 26 +++--- .../bjc/utils/data/internals/WrappedOption.java | 34 ++++---- 6 files changed, 153 insertions(+), 150 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/internals') diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazy.java b/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazy.java index cc1c0c0..e5f1b95 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazy.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazy.java @@ -1,14 +1,14 @@ package bjc.utils.data.internals; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.function.UnaryOperator; + import bjc.utils.data.IHolder; import bjc.utils.data.Lazy; import bjc.utils.funcdata.FunctionalList; import bjc.utils.funcdata.IList; -import java.util.function.Function; -import java.util.function.Supplier; -import java.util.function.UnaryOperator; - /* * Implements a lazy holder that has been bound */ @@ -17,12 +17,12 @@ public class BoundLazy implements IHolder> oldSupplier; + private final Supplier> oldSupplier; /* * The function to use to transform the old value into a new value */ - private Function> binder; + private final Function> binder; /* * The bound value being held @@ -37,30 +37,31 @@ public class BoundLazy implements IHolder> actions = new FunctionalList<>(); + private final IList> actions = new FunctionalList<>(); /* * Create a new bound lazy value */ - public BoundLazy(Supplier> supp, Function> binder) { + public BoundLazy(final Supplier> supp, + final Function> binder) { oldSupplier = supp; this.binder = binder; } @Override - public IHolder bind(Function> bindr) { + public IHolder bind(final Function> bindr) { if (bindr == null) throw new NullPointerException("Binder must not be null"); /* * Prepare a list of pending actions */ - IList> pendingActions = new FunctionalList<>(); + final IList> pendingActions = new FunctionalList<>(); actions.forEach(pendingActions::add); /* * Create the new supplier of a value */ - Supplier> typeSupplier = () -> { + final Supplier> typeSupplier = () -> { IHolder oldHolder = boundHolder; /* @@ -83,7 +84,7 @@ public class BoundLazy implements IHolder Function> lift( - Function func) { + final Function func) { if (func == null) throw new NullPointerException("Function to lift must not be null"); return (val) -> { @@ -92,15 +93,15 @@ public class BoundLazy implements IHolder IHolder map(Function mapper) { + public IHolder map(final Function mapper) { if (mapper == null) throw new NullPointerException("Mapper must not be null"); // Prepare a list of pending actions - IList> pendingActions = new FunctionalList<>(); + final IList> pendingActions = new FunctionalList<>(); actions.forEach(pendingActions::add); // Prepare the new supplier - Supplier typeSupplier = () -> { + final Supplier typeSupplier = () -> { IHolder oldHolder = boundHolder; // Bound the value if it hasn't been bound @@ -124,7 +125,7 @@ public class BoundLazy implements IHolder transform(UnaryOperator transformer) { + public IHolder transform(final UnaryOperator transformer) { if (transformer == null) throw new NullPointerException("Transformer must not be null"); actions.add(transformer); @@ -133,7 +134,7 @@ public class BoundLazy implements IHolder UnwrappedType unwrap(Function unwrapper) { + public UnwrappedType unwrap(final Function unwrapper) { if (unwrapper == null) throw new NullPointerException("Unwrapper must not be null"); if (!holderBound) { diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazyPair.java b/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazyPair.java index de290a6..9333e15 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazyPair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundLazyPair.java @@ -1,14 +1,14 @@ package bjc.utils.data.internals; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Supplier; + import bjc.utils.data.IHolder; import bjc.utils.data.IPair; import bjc.utils.data.Identity; import bjc.utils.data.LazyPair; -import java.util.function.BiFunction; -import java.util.function.Function; -import java.util.function.Supplier; - /* * Implements a lazy pair that has been bound */ @@ -17,16 +17,16 @@ public class BoundLazyPair implements IPai /* * The supplier of the left value */ - private Supplier leftSupplier; + private final Supplier leftSupplier; /* * The supplier of the right value */ - private Supplier rightSupplier; + private final Supplier rightSupplier; /* * The binder to transform values */ - private BiFunction> binder; + private final BiFunction> binder; /* * The bound pair @@ -38,8 +38,8 @@ public class BoundLazyPair implements IPai */ private boolean pairBound; - public BoundLazyPair(Supplier leftSupp, Supplier rightSupp, - BiFunction> bindr) { + public BoundLazyPair(final Supplier leftSupp, final Supplier rightSupp, + final BiFunction> bindr) { leftSupplier = leftSupp; rightSupplier = rightSupp; binder = bindr; @@ -47,14 +47,14 @@ public class BoundLazyPair implements IPai @Override public IPair bind( - BiFunction> bindr) { - if(bindr == null) throw new NullPointerException("Binder must not be null"); + final BiFunction> bindr) { + if (bindr == null) throw new NullPointerException("Binder must not be null"); - IHolder> newPair = new Identity<>(boundPair); - IHolder newPairMade = new Identity<>(pairBound); + final IHolder> newPair = new Identity<>(boundPair); + final IHolder newPairMade = new Identity<>(pairBound); - Supplier leftSupp = () -> { - if(!newPairMade.getValue()) { + final Supplier leftSupp = () -> { + if (!newPairMade.getValue()) { newPair.replace(binder.apply(leftSupplier.get(), rightSupplier.get())); newPairMade.replace(true); @@ -63,8 +63,8 @@ public class BoundLazyPair implements IPai return newPair.unwrap((pair) -> pair.getLeft()); }; - Supplier rightSupp = () -> { - if(!newPairMade.getValue()) { + final Supplier rightSupp = () -> { + if (!newPairMade.getValue()) { newPair.replace(binder.apply(leftSupplier.get(), rightSupplier.get())); newPairMade.replace(true); @@ -78,13 +78,13 @@ public class BoundLazyPair implements IPai @Override public IPair bindLeft( - Function> leftBinder) { - if(leftBinder == null) throw new NullPointerException("Left binder must not be null"); + final Function> leftBinder) { + if (leftBinder == null) throw new NullPointerException("Left binder must not be null"); - Supplier leftSupp = () -> { + final Supplier leftSupp = () -> { IPair newPair = boundPair; - if(!pairBound) { + if (!pairBound) { newPair = binder.apply(leftSupplier.get(), rightSupplier.get()); } @@ -96,13 +96,13 @@ public class BoundLazyPair implements IPai @Override public IPair bindRight( - Function> rightBinder) { - if(rightBinder == null) throw new NullPointerException("Right binder must not be null"); + final Function> rightBinder) { + if (rightBinder == null) throw new NullPointerException("Right binder must not be null"); - Supplier rightSupp = () -> { + final Supplier rightSupp = () -> { IPair newPair = boundPair; - if(!pairBound) { + if (!pairBound) { newPair = binder.apply(leftSupplier.get(), rightSupplier.get()); } @@ -114,14 +114,14 @@ public class BoundLazyPair implements IPai @Override public IPair combine( - IPair otherPair, - BiFunction leftCombiner, - BiFunction rightCombiner) { - if(otherPair == null) + final IPair otherPair, + final BiFunction leftCombiner, + final BiFunction rightCombiner) { + if (otherPair == null) throw new NullPointerException("Other pair must not be null"); - else if(leftCombiner == null) + else if (leftCombiner == null) throw new NullPointerException("Left combiner must not be null"); - else if(rightCombiner == null) throw new NullPointerException("Right combiner must not be null"); + else if (rightCombiner == null) throw new NullPointerException("Right combiner must not be null"); return otherPair.bind((otherLeft, otherRight) -> { return bind((leftVal, rightVal) -> { @@ -132,12 +132,12 @@ public class BoundLazyPair implements IPai } @Override - public IPair mapLeft(Function mapper) { - if(mapper == null) throw new NullPointerException("Mapper must not be null"); + public IPair mapLeft(final Function mapper) { + if (mapper == null) throw new NullPointerException("Mapper must not be null"); - Supplier leftSupp = () -> { - if(!pairBound) { - NewLeft leftVal = binder.apply(leftSupplier.get(), rightSupplier.get()).getLeft(); + final Supplier leftSupp = () -> { + if (!pairBound) { + final NewLeft leftVal = binder.apply(leftSupplier.get(), rightSupplier.get()).getLeft(); return mapper.apply(leftVal); } @@ -145,8 +145,8 @@ public class BoundLazyPair implements IPai return mapper.apply(boundPair.getLeft()); }; - Supplier rightSupp = () -> { - if(!pairBound) return binder.apply(leftSupplier.get(), rightSupplier.get()).getRight(); + final Supplier rightSupp = () -> { + if (!pairBound) return binder.apply(leftSupplier.get(), rightSupplier.get()).getRight(); return boundPair.getRight(); }; @@ -155,18 +155,19 @@ public class BoundLazyPair implements IPai } @Override - public IPair mapRight(Function mapper) { - if(mapper == null) throw new NullPointerException("Mapper must not be null"); + public IPair mapRight(final Function mapper) { + if (mapper == null) throw new NullPointerException("Mapper must not be null"); - Supplier leftSupp = () -> { - if(!pairBound) return binder.apply(leftSupplier.get(), rightSupplier.get()).getLeft(); + final Supplier leftSupp = () -> { + if (!pairBound) return binder.apply(leftSupplier.get(), rightSupplier.get()).getLeft(); return boundPair.getLeft(); }; - Supplier rightSupp = () -> { - if(!pairBound) { - NewRight rightVal = binder.apply(leftSupplier.get(), rightSupplier.get()).getRight(); + final Supplier rightSupp = () -> { + if (!pairBound) { + final NewRight rightVal = binder.apply(leftSupplier.get(), rightSupplier.get()) + .getRight(); return mapper.apply(rightVal); } @@ -178,10 +179,10 @@ public class BoundLazyPair implements IPai } @Override - public MergedType merge(BiFunction merger) { - if(merger == null) throw new NullPointerException("Merger must not be null"); + public MergedType merge(final BiFunction merger) { + if (merger == null) throw new NullPointerException("Merger must not be null"); - if(!pairBound) { + if (!pairBound) { boundPair = binder.apply(leftSupplier.get(), rightSupplier.get()); pairBound = true; @@ -192,7 +193,7 @@ public class BoundLazyPair implements IPai @Override public String toString() { - if(pairBound) return boundPair.toString(); + if (pairBound) return boundPair.toString(); return "(un-materialized)"; } diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundListHolder.java b/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundListHolder.java index c838ce7..65a6f3d 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundListHolder.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/internals/BoundListHolder.java @@ -1,28 +1,28 @@ package bjc.utils.data.internals; +import java.util.function.Function; +import java.util.function.UnaryOperator; + import bjc.utils.data.IHolder; import bjc.utils.data.ListHolder; import bjc.utils.funcdata.IList; -import java.util.function.Function; -import java.util.function.UnaryOperator; - /* * Holds a list, converted into a holder */ @SuppressWarnings("javadoc") public class BoundListHolder implements IHolder { - private IList> heldHolders; + private final IList> heldHolders; - public BoundListHolder(IList> toHold) { + public BoundListHolder(final IList> toHold) { heldHolders = toHold; } @Override - public IHolder bind(Function> binder) { - if(binder == null) throw new NullPointerException("Binder must not be null"); + public IHolder bind(final Function> binder) { + if (binder == null) throw new NullPointerException("Binder must not be null"); - IList> boundHolders = heldHolders.map((containedHolder) -> { + final IList> boundHolders = heldHolders.map((containedHolder) -> { return containedHolder.bind(binder); }); @@ -30,8 +30,8 @@ public class BoundListHolder implements IHolder { } @Override - public Function> lift(Function func) { - if(func == null) throw new NullPointerException("Function to lift must not be null"); + public Function> lift(final Function func) { + if (func == null) throw new NullPointerException("Function to lift must not be null"); return (val) -> { return new ListHolder<>(func.apply(val)); @@ -39,10 +39,10 @@ public class BoundListHolder implements IHolder { } @Override - public IHolder map(Function mapper) { - if(mapper == null) throw new NullPointerException("Mapper must not be null"); + public IHolder map(final Function mapper) { + if (mapper == null) throw new NullPointerException("Mapper must not be null"); - IList> mappedHolders = heldHolders.map((containedHolder) -> { + final IList> mappedHolders = heldHolders.map((containedHolder) -> { return containedHolder.map(mapper); }); @@ -50,8 +50,8 @@ public class BoundListHolder implements IHolder { } @Override - public IHolder transform(UnaryOperator transformer) { - if(transformer == null) throw new NullPointerException("Transformer must not be null"); + public IHolder transform(final UnaryOperator transformer) { + if (transformer == null) throw new NullPointerException("Transformer must not be null"); heldHolders.forEach((containedHolder) -> { containedHolder.transform(transformer); @@ -61,8 +61,8 @@ public class BoundListHolder implements IHolder { } @Override - public UnwrappedType unwrap(Function unwrapper) { - if(unwrapper == null) throw new NullPointerException("Unwrapper must not be null"); + public UnwrappedType unwrap(final Function unwrapper) { + if (unwrapper == null) throw new NullPointerException("Unwrapper must not be null"); return heldHolders.randItem().unwrap(unwrapper); } diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/internals/HalfBoundLazyPair.java b/BJC-Utils2/src/main/java/bjc/utils/data/internals/HalfBoundLazyPair.java index 35df1c3..a603a7f 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/internals/HalfBoundLazyPair.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/internals/HalfBoundLazyPair.java @@ -1,39 +1,40 @@ package bjc.utils.data.internals; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Supplier; + import bjc.utils.data.IHolder; import bjc.utils.data.IPair; import bjc.utils.data.Identity; import bjc.utils.data.LazyPair; -import java.util.function.BiFunction; -import java.util.function.Function; -import java.util.function.Supplier; - /* * A lazy pair, with only one side bound */ @SuppressWarnings("javadoc") public class HalfBoundLazyPair implements IPair { - private Supplier oldSupplier; + private final Supplier oldSupplier; - private Function> binder; + private final Function> binder; private IPair boundPair; private boolean pairBound; - public HalfBoundLazyPair(Supplier oldSupp, Function> bindr) { + public HalfBoundLazyPair(final Supplier oldSupp, + final Function> bindr) { oldSupplier = oldSupp; binder = bindr; } @Override public IPair bind( - BiFunction> bindr) { - IHolder> newPair = new Identity<>(boundPair); - IHolder newPairMade = new Identity<>(pairBound); + final BiFunction> bindr) { + final IHolder> newPair = new Identity<>(boundPair); + final IHolder newPairMade = new Identity<>(pairBound); - Supplier leftSupp = () -> { - if(!newPairMade.getValue()) { + final Supplier leftSupp = () -> { + if (!newPairMade.getValue()) { newPair.replace(binder.apply(oldSupplier.get())); newPairMade.replace(true); } @@ -41,8 +42,8 @@ public class HalfBoundLazyPair implements IPair pair.getLeft()); }; - Supplier rightSupp = () -> { - if(!newPairMade.getValue()) { + final Supplier rightSupp = () -> { + if (!newPairMade.getValue()) { newPair.replace(binder.apply(oldSupplier.get())); newPairMade.replace(true); } @@ -55,11 +56,11 @@ public class HalfBoundLazyPair implements IPair IPair bindLeft( - Function> leftBinder) { - Supplier leftSupp = () -> { + final Function> leftBinder) { + final Supplier leftSupp = () -> { IPair newPair = boundPair; - if(!pairBound) { + if (!pairBound) { newPair = binder.apply(oldSupplier.get()); } @@ -71,11 +72,11 @@ public class HalfBoundLazyPair implements IPair IPair bindRight( - Function> rightBinder) { - Supplier rightSupp = () -> { + final Function> rightBinder) { + final Supplier rightSupp = () -> { IPair newPair = boundPair; - if(!pairBound) { + if (!pairBound) { newPair = binder.apply(oldSupplier.get()); } @@ -87,9 +88,9 @@ public class HalfBoundLazyPair implements IPair IPair combine( - IPair otherPair, - BiFunction leftCombiner, - BiFunction rightCombiner) { + final IPair otherPair, + final BiFunction leftCombiner, + final BiFunction rightCombiner) { return otherPair.bind((otherLeft, otherRight) -> { return bind((leftVal, rightVal) -> { return new LazyPair<>(leftCombiner.apply(leftVal, otherLeft), @@ -99,17 +100,17 @@ public class HalfBoundLazyPair implements IPair IPair mapLeft(Function mapper) { - Supplier leftSupp = () -> { - if(pairBound) return mapper.apply(boundPair.getLeft()); + public IPair mapLeft(final Function mapper) { + final Supplier leftSupp = () -> { + if (pairBound) return mapper.apply(boundPair.getLeft()); - NewLeft leftVal = binder.apply(oldSupplier.get()).getLeft(); + final NewLeft leftVal = binder.apply(oldSupplier.get()).getLeft(); return mapper.apply(leftVal); }; - Supplier rightSupp = () -> { - if(pairBound) return boundPair.getRight(); + final Supplier rightSupp = () -> { + if (pairBound) return boundPair.getRight(); return binder.apply(oldSupplier.get()).getRight(); }; @@ -118,17 +119,17 @@ public class HalfBoundLazyPair implements IPair IPair mapRight(Function mapper) { - Supplier leftSupp = () -> { - if(pairBound) return boundPair.getLeft(); + public IPair mapRight(final Function mapper) { + final Supplier leftSupp = () -> { + if (pairBound) return boundPair.getLeft(); return binder.apply(oldSupplier.get()).getLeft(); }; - Supplier rightSupp = () -> { - if(pairBound) return mapper.apply(boundPair.getRight()); + final Supplier rightSupp = () -> { + if (pairBound) return mapper.apply(boundPair.getRight()); - NewRight rightVal = binder.apply(oldSupplier.get()).getRight(); + final NewRight rightVal = binder.apply(oldSupplier.get()).getRight(); return mapper.apply(rightVal); }; @@ -137,8 +138,8 @@ public class HalfBoundLazyPair implements IPair MergedType merge(BiFunction merger) { - if(!pairBound) { + public MergedType merge(final BiFunction merger) { + if (!pairBound) { boundPair = binder.apply(oldSupplier.get()); pairBound = true; diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/internals/WrappedLazy.java b/BJC-Utils2/src/main/java/bjc/utils/data/internals/WrappedLazy.java index de161e5..d2e2b98 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/internals/WrappedLazy.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/internals/WrappedLazy.java @@ -1,28 +1,28 @@ package bjc.utils.data.internals; -import bjc.utils.data.IHolder; -import bjc.utils.data.Lazy; - import java.util.function.Function; import java.util.function.UnaryOperator; +import bjc.utils.data.IHolder; +import bjc.utils.data.Lazy; + @SuppressWarnings("javadoc") public class WrappedLazy implements IHolder { - private IHolder> held; + private final IHolder> held; - public WrappedLazy(IHolder wrappedHolder) { + public WrappedLazy(final IHolder wrappedHolder) { held = new Lazy<>(wrappedHolder); } // This has an extra parameter, because otherwise it erases to the same // as the public one - private WrappedLazy(IHolder> wrappedHolder, boolean dummy) { + private WrappedLazy(final IHolder> wrappedHolder, final boolean dummy) { held = wrappedHolder; } @Override - public IHolder bind(Function> binder) { - IHolder> newHolder = held.map((containedHolder) -> { + public IHolder bind(final Function> binder) { + final IHolder> newHolder = held.map((containedHolder) -> { return containedHolder.bind(binder); }); @@ -30,15 +30,15 @@ public class WrappedLazy implements IHolder { } @Override - public Function> lift(Function func) { + public Function> lift(final Function func) { return (val) -> { return new Lazy<>(func.apply(val)); }; } @Override - public IHolder map(Function mapper) { - IHolder> newHolder = held.map((containedHolder) -> { + public IHolder map(final Function mapper) { + final IHolder> newHolder = held.map((containedHolder) -> { return containedHolder.map(mapper); }); @@ -46,7 +46,7 @@ public class WrappedLazy implements IHolder { } @Override - public IHolder transform(UnaryOperator transformer) { + public IHolder transform(final UnaryOperator transformer) { held.transform((containedHolder) -> { return containedHolder.transform(transformer); }); @@ -55,7 +55,7 @@ public class WrappedLazy implements IHolder { } @Override - public UnwrappedType unwrap(Function unwrapper) { + public UnwrappedType unwrap(final Function unwrapper) { return held.unwrap((containedHolder) -> { return containedHolder.unwrap(unwrapper); }); diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/internals/WrappedOption.java b/BJC-Utils2/src/main/java/bjc/utils/data/internals/WrappedOption.java index e98332c..da53ab8 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/internals/WrappedOption.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/internals/WrappedOption.java @@ -1,28 +1,28 @@ package bjc.utils.data.internals; -import bjc.utils.data.IHolder; -import bjc.utils.data.Option; - import java.util.function.Function; import java.util.function.UnaryOperator; +import bjc.utils.data.IHolder; +import bjc.utils.data.Option; + @SuppressWarnings("javadoc") public class WrappedOption implements IHolder { - private IHolder> held; + private final IHolder> held; - public WrappedOption(IHolder seedValue) { + public WrappedOption(final IHolder seedValue) { held = new Option<>(seedValue); } - private WrappedOption(IHolder> toHold, boolean dummy) { + private WrappedOption(final IHolder> toHold, final boolean dummy) { held = toHold; } @Override - public IHolder bind(Function> binder) { - IHolder> newHolder = held.map((containedHolder) -> { + public IHolder bind(final Function> binder) { + final IHolder> newHolder = held.map((containedHolder) -> { return containedHolder.bind((containedValue) -> { - if(containedValue == null) return new Option<>(null); + if (containedValue == null) return new Option<>(null); return binder.apply(containedValue); }); @@ -32,17 +32,17 @@ public class WrappedOption implements IHolder { } @Override - public Function> lift(Function func) { + public Function> lift(final Function func) { return (val) -> { return new Option<>(func.apply(val)); }; } @Override - public IHolder map(Function mapper) { - IHolder> newHolder = held.map((containedHolder) -> { + public IHolder map(final Function mapper) { + final IHolder> newHolder = held.map((containedHolder) -> { return containedHolder.map((containedValue) -> { - if(containedValue == null) return null; + if (containedValue == null) return null; return mapper.apply(containedValue); }); @@ -52,10 +52,10 @@ public class WrappedOption implements IHolder { } @Override - public IHolder transform(UnaryOperator transformer) { + public IHolder transform(final UnaryOperator transformer) { held.transform((containedHolder) -> { return containedHolder.transform((containedValue) -> { - if(containedValue == null) return null; + if (containedValue == null) return null; return transformer.apply(containedValue); }); @@ -65,10 +65,10 @@ public class WrappedOption implements IHolder { } @Override - public UnwrappedType unwrap(Function unwrapper) { + public UnwrappedType unwrap(final Function unwrapper) { return held.unwrap((containedHolder) -> { return containedHolder.unwrap((containedValue) -> { - if(containedValue == null) return null; + if (containedValue == null) return null; return unwrapper.apply(containedValue); }); -- cgit v1.2.3