diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-12-03 19:21:38 -0500 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-12-03 19:21:38 -0500 |
| commit | 0a8f34c27c6ef93c5c94d17728af62c7607e225f (patch) | |
| tree | 3bbbbb6d62649c7411e7ae3d53a75786255ed84e /src/main/java/bjc/data/internals | |
| parent | 097a33bc2ecaa64a664550ddd62ccd8de47c51d0 (diff) | |
Rename types to match Java style
This renames several interfaces that had names like IWhatever, since
that isn't a style that Java uses
Diffstat (limited to 'src/main/java/bjc/data/internals')
| -rw-r--r-- | src/main/java/bjc/data/internals/BoundLazy.java | 38 | ||||
| -rw-r--r-- | src/main/java/bjc/data/internals/BoundLazyPair.java | 40 | ||||
| -rw-r--r-- | src/main/java/bjc/data/internals/BoundListHolder.java | 24 | ||||
| -rw-r--r-- | src/main/java/bjc/data/internals/HalfBoundLazyPair.java | 40 | ||||
| -rw-r--r-- | src/main/java/bjc/data/internals/WrappedLazy.java | 24 | ||||
| -rw-r--r-- | src/main/java/bjc/data/internals/WrappedOption.java | 24 |
6 files changed, 95 insertions, 95 deletions
diff --git a/src/main/java/bjc/data/internals/BoundLazy.java b/src/main/java/bjc/data/internals/BoundLazy.java index a350a2b..0e0e95c 100644 --- a/src/main/java/bjc/data/internals/BoundLazy.java +++ b/src/main/java/bjc/data/internals/BoundLazy.java @@ -4,10 +4,10 @@ import java.util.function.Function; import java.util.function.Supplier; import java.util.function.UnaryOperator; -import bjc.data.IHolder; +import bjc.data.Holder; import bjc.data.Lazy; import bjc.funcdata.FunctionalList; -import bjc.funcdata.IList; +import bjc.funcdata.ListEx; /** * Implements a lazy holder that has been bound. @@ -19,21 +19,21 @@ import bjc.funcdata.IList; * The type of the new bound value. */ public class BoundLazy<OldType, BoundContainedType> - implements IHolder<BoundContainedType> { + implements Holder<BoundContainedType> { /* The old value. */ - private final Supplier<IHolder<OldType>> oldSupplier; + private final Supplier<Holder<OldType>> oldSupplier; /* The function to use to transform the old value into a new value. */ - private final Function<OldType, IHolder<BoundContainedType>> binder; + private final Function<OldType, Holder<BoundContainedType>> binder; /* The bound value being held. */ - private IHolder<BoundContainedType> boundHolder; + private Holder<BoundContainedType> boundHolder; /* Whether the bound value has been actualized or not. */ private boolean holderBound; /* Transformations currently pending on the bound value. */ - private final IList<UnaryOperator<BoundContainedType>> actions + private final ListEx<UnaryOperator<BoundContainedType>> actions = new FunctionalList<>(); /** @@ -45,20 +45,20 @@ public class BoundLazy<OldType, BoundContainedType> * @param binder * The function to use to bind the old value to the new one. */ - public BoundLazy(final Supplier<IHolder<OldType>> supp, - final Function<OldType, IHolder<BoundContainedType>> binder) { + public BoundLazy(final Supplier<Holder<OldType>> supp, + final Function<OldType, Holder<BoundContainedType>> binder) { oldSupplier = supp; this.binder = binder; } @Override - public <BoundType> IHolder<BoundType> - bind(final Function<BoundContainedType, IHolder<BoundType>> bindr) { + public <BoundType> Holder<BoundType> + bind(final Function<BoundContainedType, Holder<BoundType>> bindr) { if (bindr == null) throw new NullPointerException("Binder must not be null"); /* Prepare a list of pending actions. */ - final IList<UnaryOperator<BoundContainedType>> pendingActions + final ListEx<UnaryOperator<BoundContainedType>> pendingActions = new FunctionalList<>(); for (UnaryOperator<BoundContainedType> pendAct : actions) { @@ -66,8 +66,8 @@ public class BoundLazy<OldType, BoundContainedType> } /* Create the new supplier of a value. */ - final Supplier<IHolder<BoundContainedType>> typeSupplier = () -> { - IHolder<BoundContainedType> oldHolder = boundHolder; + final Supplier<Holder<BoundContainedType>> typeSupplier = () -> { + Holder<BoundContainedType> oldHolder = boundHolder; /* Bind the value if it hasn't been bound before. */ if (!holderBound) { @@ -83,7 +83,7 @@ public class BoundLazy<OldType, BoundContainedType> } @Override - public <NewType> Function<BoundContainedType, IHolder<NewType>> + public <NewType> Function<BoundContainedType, Holder<NewType>> lift(final Function<BoundContainedType, NewType> func) { if (func == null) throw new NullPointerException("Function to lift must not be null"); @@ -94,13 +94,13 @@ public class BoundLazy<OldType, BoundContainedType> } @Override - public <MappedType> IHolder<MappedType> + public <MappedType> Holder<MappedType> map(final Function<BoundContainedType, MappedType> mapper) { if (mapper == null) throw new NullPointerException("Mapper must not be null"); /* Prepare a list of pending actions. */ - final IList<UnaryOperator<BoundContainedType>> pendingActions + final ListEx<UnaryOperator<BoundContainedType>> pendingActions = new FunctionalList<>(); for (UnaryOperator<BoundContainedType> pendAct : actions) { @@ -109,7 +109,7 @@ public class BoundLazy<OldType, BoundContainedType> /* Prepare the new supplier. */ final Supplier<MappedType> typeSupplier = () -> { - IHolder<BoundContainedType> oldHolder = boundHolder; + Holder<BoundContainedType> oldHolder = boundHolder; /* Bound the value if it hasn't been bound. */ if (!holderBound) { @@ -133,7 +133,7 @@ public class BoundLazy<OldType, BoundContainedType> } @Override - public IHolder<BoundContainedType> + public Holder<BoundContainedType> transform(final UnaryOperator<BoundContainedType> transformer) { if (transformer == null) throw new NullPointerException("Transformer must not be null"); diff --git a/src/main/java/bjc/data/internals/BoundLazyPair.java b/src/main/java/bjc/data/internals/BoundLazyPair.java index e081c04..91981de 100644 --- a/src/main/java/bjc/data/internals/BoundLazyPair.java +++ b/src/main/java/bjc/data/internals/BoundLazyPair.java @@ -4,8 +4,8 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; -import bjc.data.IHolder; -import bjc.data.IPair; +import bjc.data.Holder; +import bjc.data.Pair; import bjc.data.Identity; import bjc.data.LazyPair; @@ -16,17 +16,17 @@ import bjc.data.LazyPair; */ @SuppressWarnings("javadoc") public class BoundLazyPair<OldLeft, OldRight, NewLeft, NewRight> - implements IPair<NewLeft, NewRight> { + implements Pair<NewLeft, NewRight> { /* The supplier of the left value. */ private final Supplier<OldLeft> leftSupplier; /* The supplier of the right value. */ private final Supplier<OldRight> rightSupplier; /* The binder to transform values. */ - private final BiFunction<OldLeft, OldRight, IPair<NewLeft, NewRight>> binder; + private final BiFunction<OldLeft, OldRight, Pair<NewLeft, NewRight>> binder; /* The bound pair. */ - private IPair<NewLeft, NewRight> boundPair; + private Pair<NewLeft, NewRight> boundPair; /* Whether the pair has been bound yet. */ private boolean pairBound; @@ -46,20 +46,20 @@ public class BoundLazyPair<OldLeft, OldRight, NewLeft, NewRight> */ public BoundLazyPair(final Supplier<OldLeft> leftSupp, final Supplier<OldRight> rightSupp, - final BiFunction<OldLeft, OldRight, IPair<NewLeft, NewRight>> bindr) { + final BiFunction<OldLeft, OldRight, Pair<NewLeft, NewRight>> bindr) { leftSupplier = leftSupp; rightSupplier = rightSupp; binder = bindr; } @Override - public <BoundLeft, BoundRight> IPair<BoundLeft, BoundRight> bind( - final BiFunction<NewLeft, NewRight, IPair<BoundLeft, BoundRight>> bindr) { + public <BoundLeft, BoundRight> Pair<BoundLeft, BoundRight> bind( + final BiFunction<NewLeft, NewRight, Pair<BoundLeft, BoundRight>> bindr) { if (bindr == null) throw new NullPointerException("Binder must not be null"); - final IHolder<IPair<NewLeft, NewRight>> newPair = new Identity<>(boundPair); - final IHolder<Boolean> newPairMade = new Identity<>(pairBound); + final Holder<Pair<NewLeft, NewRight>> newPair = new Identity<>(boundPair); + final Holder<Boolean> newPairMade = new Identity<>(pairBound); final Supplier<NewLeft> leftSupp = () -> { if (!newPairMade.getValue()) { @@ -91,13 +91,13 @@ public class BoundLazyPair<OldLeft, OldRight, NewLeft, NewRight> } @Override - public <BoundLeft> IPair<BoundLeft, NewRight> - bindLeft(final Function<NewLeft, IPair<BoundLeft, NewRight>> leftBinder) { + public <BoundLeft> Pair<BoundLeft, NewRight> + bindLeft(final Function<NewLeft, Pair<BoundLeft, NewRight>> leftBinder) { if (leftBinder == null) throw new NullPointerException("Left binder must not be null"); final Supplier<NewLeft> leftSupp = () -> { - IPair<NewLeft, NewRight> newPair = boundPair; + Pair<NewLeft, NewRight> newPair = boundPair; if (!pairBound) { /* @@ -113,13 +113,13 @@ public class BoundLazyPair<OldLeft, OldRight, NewLeft, NewRight> } @Override - public <BoundRight> IPair<NewLeft, BoundRight> - bindRight(final Function<NewRight, IPair<NewLeft, BoundRight>> rightBinder) { + public <BoundRight> Pair<NewLeft, BoundRight> + bindRight(final Function<NewRight, Pair<NewLeft, BoundRight>> rightBinder) { if (rightBinder == null) throw new NullPointerException("Right binder must not be null"); final Supplier<NewRight> rightSupp = () -> { - IPair<NewLeft, NewRight> newPair = boundPair; + Pair<NewLeft, NewRight> newPair = boundPair; if (!pairBound) { /* @@ -136,8 +136,8 @@ public class BoundLazyPair<OldLeft, OldRight, NewLeft, NewRight> @Override public <OtherLeft, OtherRight, CombinedLeft, CombinedRight> - IPair<CombinedLeft, CombinedRight> - combine(final IPair<OtherLeft, OtherRight> otherPair, + Pair<CombinedLeft, CombinedRight> + combine(final Pair<OtherLeft, OtherRight> otherPair, final BiFunction<NewLeft, OtherLeft, CombinedLeft> leftCombiner, final BiFunction<NewRight, OtherRight, CombinedRight> rightCombiner) { if (otherPair == null) { @@ -157,7 +157,7 @@ public class BoundLazyPair<OldLeft, OldRight, NewLeft, NewRight> } @Override - public <NewLeftType> IPair<NewLeftType, NewRight> + public <NewLeftType> Pair<NewLeftType, NewRight> mapLeft(final Function<NewLeft, NewLeftType> mapper) { if (mapper == null) throw new NullPointerException("Mapper must not be null"); @@ -184,7 +184,7 @@ public class BoundLazyPair<OldLeft, OldRight, NewLeft, NewRight> } @Override - public <NewRightType> IPair<NewLeft, NewRightType> + public <NewRightType> Pair<NewLeft, NewRightType> mapRight(final Function<NewRight, NewRightType> mapper) { if (mapper == null) throw new NullPointerException("Mapper must not be null"); diff --git a/src/main/java/bjc/data/internals/BoundListHolder.java b/src/main/java/bjc/data/internals/BoundListHolder.java index 1193c8d..c944252 100644 --- a/src/main/java/bjc/data/internals/BoundListHolder.java +++ b/src/main/java/bjc/data/internals/BoundListHolder.java @@ -3,9 +3,9 @@ package bjc.data.internals; import java.util.function.Function; import java.util.function.UnaryOperator; -import bjc.data.IHolder; +import bjc.data.Holder; import bjc.data.ListHolder; -import bjc.funcdata.IList; +import bjc.funcdata.ListEx; /** * Holds a list, converted into a holder. @@ -13,9 +13,9 @@ import bjc.funcdata.IList; * @author Ben Culkin */ @SuppressWarnings("javadoc") -public class BoundListHolder<ContainedType> implements IHolder<ContainedType> { +public class BoundListHolder<ContainedType> implements Holder<ContainedType> { /* The list of contained holders. */ - private final IList<IHolder<ContainedType>> heldHolders; + private final ListEx<Holder<ContainedType>> heldHolders; /** * Create a new list of holders. @@ -23,17 +23,17 @@ public class BoundListHolder<ContainedType> implements IHolder<ContainedType> { * @param toHold * The list of holders to, well, hold. */ - public BoundListHolder(final IList<IHolder<ContainedType>> toHold) { + public BoundListHolder(final ListEx<Holder<ContainedType>> toHold) { heldHolders = toHold; } @Override - public <BoundType> IHolder<BoundType> - bind(final Function<ContainedType, IHolder<BoundType>> binder) { + public <BoundType> Holder<BoundType> + bind(final Function<ContainedType, Holder<BoundType>> binder) { if (binder == null) throw new NullPointerException("Binder must not be null"); - final IList<IHolder<BoundType>> boundHolders + final ListEx<Holder<BoundType>> boundHolders = heldHolders.map(containedHolder -> { return containedHolder.bind(binder); }); @@ -42,7 +42,7 @@ public class BoundListHolder<ContainedType> implements IHolder<ContainedType> { } @Override - public <NewType> Function<ContainedType, IHolder<NewType>> + public <NewType> Function<ContainedType, Holder<NewType>> lift(final Function<ContainedType, NewType> func) { if (func == null) throw new NullPointerException("Function to lift must not be null"); @@ -53,12 +53,12 @@ public class BoundListHolder<ContainedType> implements IHolder<ContainedType> { } @Override - public <MappedType> IHolder<MappedType> + public <MappedType> Holder<MappedType> map(final Function<ContainedType, MappedType> mapper) { if (mapper == null) throw new NullPointerException("Mapper must not be null"); - final IList<IHolder<MappedType>> mappedHolders + final ListEx<Holder<MappedType>> mappedHolders = heldHolders.map(containedHolder -> { return containedHolder.map(mapper); }); @@ -67,7 +67,7 @@ public class BoundListHolder<ContainedType> implements IHolder<ContainedType> { } @Override - public IHolder<ContainedType> + public Holder<ContainedType> transform(final UnaryOperator<ContainedType> transformer) { if (transformer == null) throw new NullPointerException("Transformer must not be null"); diff --git a/src/main/java/bjc/data/internals/HalfBoundLazyPair.java b/src/main/java/bjc/data/internals/HalfBoundLazyPair.java index 6bcb6ae..849b973 100644 --- a/src/main/java/bjc/data/internals/HalfBoundLazyPair.java +++ b/src/main/java/bjc/data/internals/HalfBoundLazyPair.java @@ -4,8 +4,8 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; -import bjc.data.IHolder; -import bjc.data.IPair; +import bjc.data.Holder; +import bjc.data.Pair; import bjc.data.Identity; import bjc.data.LazyPair; @@ -24,15 +24,15 @@ import bjc.data.LazyPair; */ @SuppressWarnings("javadoc") public class HalfBoundLazyPair<OldType, NewLeft, NewRight> - implements IPair<NewLeft, NewRight> { + implements Pair<NewLeft, NewRight> { /* The supplier of the old value. */ private final Supplier<OldType> oldSupplier; /* The function to transform the old value into a new pair. */ - private final Function<OldType, IPair<NewLeft, NewRight>> binder; + private final Function<OldType, Pair<NewLeft, NewRight>> binder; /* The new bound pair. */ - private IPair<NewLeft, NewRight> boundPair; + private Pair<NewLeft, NewRight> boundPair; /* Has the pair been bound yet or not? */ private boolean pairBound; @@ -46,16 +46,16 @@ public class HalfBoundLazyPair<OldType, NewLeft, NewRight> * The function to use to create the pair from the old value. */ public HalfBoundLazyPair(final Supplier<OldType> oldSupp, - final Function<OldType, IPair<NewLeft, NewRight>> bindr) { + final Function<OldType, Pair<NewLeft, NewRight>> bindr) { oldSupplier = oldSupp; binder = bindr; } @Override - public <BoundLeft, BoundRight> IPair<BoundLeft, BoundRight> bind( - final BiFunction<NewLeft, NewRight, IPair<BoundLeft, BoundRight>> bindr) { - final IHolder<IPair<NewLeft, NewRight>> newPair = new Identity<>(boundPair); - final IHolder<Boolean> newPairMade = new Identity<>(pairBound); + public <BoundLeft, BoundRight> Pair<BoundLeft, BoundRight> bind( + final BiFunction<NewLeft, NewRight, Pair<BoundLeft, BoundRight>> bindr) { + final Holder<Pair<NewLeft, NewRight>> newPair = new Identity<>(boundPair); + final Holder<Boolean> newPairMade = new Identity<>(pairBound); final Supplier<NewLeft> leftSupp = () -> { if (!newPairMade.getValue()) { @@ -81,10 +81,10 @@ public class HalfBoundLazyPair<OldType, NewLeft, NewRight> } @Override - public <BoundLeft> IPair<BoundLeft, NewRight> - bindLeft(final Function<NewLeft, IPair<BoundLeft, NewRight>> leftBinder) { + public <BoundLeft> Pair<BoundLeft, NewRight> + bindLeft(final Function<NewLeft, Pair<BoundLeft, NewRight>> leftBinder) { final Supplier<NewLeft> leftSupp = () -> { - IPair<NewLeft, NewRight> newPair = boundPair; + Pair<NewLeft, NewRight> newPair = boundPair; if (!pairBound) { newPair = binder.apply(oldSupplier.get()); @@ -97,10 +97,10 @@ public class HalfBoundLazyPair<OldType, NewLeft, NewRight> } @Override - public <BoundRight> IPair<NewLeft, BoundRight> - bindRight(final Function<NewRight, IPair<NewLeft, BoundRight>> rightBinder) { + public <BoundRight> Pair<NewLeft, BoundRight> + bindRight(final Function<NewRight, Pair<NewLeft, BoundRight>> rightBinder) { final Supplier<NewRight> rightSupp = () -> { - IPair<NewLeft, NewRight> newPair = boundPair; + Pair<NewLeft, NewRight> newPair = boundPair; if (!pairBound) { newPair = binder.apply(oldSupplier.get()); @@ -114,8 +114,8 @@ public class HalfBoundLazyPair<OldType, NewLeft, NewRight> @Override public <OtherLeft, OtherRight, CombinedLeft, CombinedRight> - IPair<CombinedLeft, CombinedRight> - combine(final IPair<OtherLeft, OtherRight> otherPair, + Pair<CombinedLeft, CombinedRight> + combine(final Pair<OtherLeft, OtherRight> otherPair, final BiFunction<NewLeft, OtherLeft, CombinedLeft> leftCombiner, final BiFunction<NewRight, OtherRight, CombinedRight> rightCombiner) { return otherPair.bind((otherLeft, otherRight) -> bind((leftVal, rightVal) -> { @@ -127,7 +127,7 @@ public class HalfBoundLazyPair<OldType, NewLeft, NewRight> } @Override - public <NewLeftType> IPair<NewLeftType, NewRight> + public <NewLeftType> Pair<NewLeftType, NewRight> mapLeft(final Function<NewLeft, NewLeftType> mapper) { final Supplier<NewLeftType> leftSupp = () -> { if (pairBound) @@ -149,7 +149,7 @@ public class HalfBoundLazyPair<OldType, NewLeft, NewRight> } @Override - public <NewRightType> IPair<NewLeft, NewRightType> + public <NewRightType> Pair<NewLeft, NewRightType> mapRight(final Function<NewRight, NewRightType> mapper) { final Supplier<NewLeft> leftSupp = () -> { if (pairBound) diff --git a/src/main/java/bjc/data/internals/WrappedLazy.java b/src/main/java/bjc/data/internals/WrappedLazy.java index cda86fd..624fb1b 100644 --- a/src/main/java/bjc/data/internals/WrappedLazy.java +++ b/src/main/java/bjc/data/internals/WrappedLazy.java @@ -3,7 +3,7 @@ package bjc.data.internals; import java.util.function.Function; import java.util.function.UnaryOperator; -import bjc.data.IHolder; +import bjc.data.Holder; import bjc.data.Lazy; /** @@ -13,9 +13,9 @@ import bjc.data.Lazy; * @param <ContainedType> * The type of the wrapped value. */ -public class WrappedLazy<ContainedType> implements IHolder<ContainedType> { +public class WrappedLazy<ContainedType> implements Holder<ContainedType> { /* Held value. */ - private final IHolder<IHolder<ContainedType>> held; + private final Holder<Holder<ContainedType>> held; /** * Create a new wrapped lazy value. @@ -23,7 +23,7 @@ public class WrappedLazy<ContainedType> implements IHolder<ContainedType> { * @param wrappedHolder * The holder to make lazy. */ - public WrappedLazy(final IHolder<ContainedType> wrappedHolder) { + public WrappedLazy(final Holder<ContainedType> wrappedHolder) { held = new Lazy<>(wrappedHolder); } @@ -34,15 +34,15 @@ public class WrappedLazy<ContainedType> implements IHolder<ContainedType> { * This is a case where reified generics would be useful, because then the * compiler could know which one we meant without the dummy parameter. */ - private WrappedLazy(final IHolder<IHolder<ContainedType>> wrappedHolder, + private WrappedLazy(final Holder<Holder<ContainedType>> wrappedHolder, @SuppressWarnings("unused") final boolean dummy) { held = wrappedHolder; } @Override - public <BoundType> IHolder<BoundType> - bind(final Function<ContainedType, IHolder<BoundType>> binder) { - final IHolder<IHolder<BoundType>> newHolder = held.map(containedHolder -> { + public <BoundType> Holder<BoundType> + bind(final Function<ContainedType, Holder<BoundType>> binder) { + final Holder<Holder<BoundType>> newHolder = held.map(containedHolder -> { return containedHolder.bind(binder); }); @@ -50,7 +50,7 @@ public class WrappedLazy<ContainedType> implements IHolder<ContainedType> { } @Override - public <NewType> Function<ContainedType, IHolder<NewType>> + public <NewType> Function<ContainedType, Holder<NewType>> lift(final Function<ContainedType, NewType> func) { return val -> { return new Lazy<>(func.apply(val)); @@ -58,9 +58,9 @@ public class WrappedLazy<ContainedType> implements IHolder<ContainedType> { } @Override - public <MappedType> IHolder<MappedType> + public <MappedType> Holder<MappedType> map(final Function<ContainedType, MappedType> mapper) { - final IHolder<IHolder<MappedType>> newHolder = held.map(containedHolder -> { + final Holder<Holder<MappedType>> newHolder = held.map(containedHolder -> { return containedHolder.map(mapper); }); @@ -68,7 +68,7 @@ public class WrappedLazy<ContainedType> implements IHolder<ContainedType> { } @Override - public IHolder<ContainedType> + public Holder<ContainedType> transform(final UnaryOperator<ContainedType> transformer) { held.transform(containedHolder -> { return containedHolder.transform(transformer); diff --git a/src/main/java/bjc/data/internals/WrappedOption.java b/src/main/java/bjc/data/internals/WrappedOption.java index 6becc16..f46d501 100644 --- a/src/main/java/bjc/data/internals/WrappedOption.java +++ b/src/main/java/bjc/data/internals/WrappedOption.java @@ -3,7 +3,7 @@ package bjc.data.internals; import java.util.function.Function; import java.util.function.UnaryOperator; -import bjc.data.IHolder; +import bjc.data.Holder; import bjc.data.Option; /** @@ -13,9 +13,9 @@ import bjc.data.Option; * @param <ContainedType> * The wrapped type. */ -public class WrappedOption<ContainedType> implements IHolder<ContainedType> { +public class WrappedOption<ContainedType> implements Holder<ContainedType> { /* The held value. */ - private final IHolder<IHolder<ContainedType>> held; + private final Holder<Holder<ContainedType>> held; /** * Create a new wrapped option. @@ -23,7 +23,7 @@ public class WrappedOption<ContainedType> implements IHolder<ContainedType> { * @param seedValue * The value to wrap. */ - public WrappedOption(final IHolder<ContainedType> seedValue) { + public WrappedOption(final Holder<ContainedType> seedValue) { held = new Option<>(seedValue); } @@ -31,15 +31,15 @@ public class WrappedOption<ContainedType> implements IHolder<ContainedType> { * The dummy parameter is to ensure the compiler can pick the right method, * because without this method erases to the same type as the public one. */ - private WrappedOption(final IHolder<IHolder<ContainedType>> toHold, + private WrappedOption(final Holder<Holder<ContainedType>> toHold, @SuppressWarnings("unused") final boolean dummy) { held = toHold; } @Override - public <BoundType> IHolder<BoundType> - bind(final Function<ContainedType, IHolder<BoundType>> binder) { - final IHolder<IHolder<BoundType>> newHolder = held.map(containedHolder -> { + public <BoundType> Holder<BoundType> + bind(final Function<ContainedType, Holder<BoundType>> binder) { + final Holder<Holder<BoundType>> newHolder = held.map(containedHolder -> { return containedHolder.bind((containedValue) -> { if (containedValue == null) return new Option<>(null); @@ -52,7 +52,7 @@ public class WrappedOption<ContainedType> implements IHolder<ContainedType> { } @Override - public <NewType> Function<ContainedType, IHolder<NewType>> + public <NewType> Function<ContainedType, Holder<NewType>> lift(final Function<ContainedType, NewType> func) { return val -> { return new Option<>(func.apply(val)); @@ -60,9 +60,9 @@ public class WrappedOption<ContainedType> implements IHolder<ContainedType> { } @Override - public <MappedType> IHolder<MappedType> + public <MappedType> Holder<MappedType> map(final Function<ContainedType, MappedType> mapper) { - final IHolder<IHolder<MappedType>> newHolder = held.map(containedHolder -> { + final Holder<Holder<MappedType>> newHolder = held.map(containedHolder -> { return containedHolder.map((containedValue) -> { if (containedValue == null) return null; @@ -75,7 +75,7 @@ public class WrappedOption<ContainedType> implements IHolder<ContainedType> { } @Override - public IHolder<ContainedType> + public Holder<ContainedType> transform(final UnaryOperator<ContainedType> transformer) { held.transform(containedHolder -> { return containedHolder.transform((containedValue) -> { |
