summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/data/internals/BoundLazy.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@mix.wvu.edu>2018-02-12 22:45:04 -0500
committerbjculkin <bjculkin@mix.wvu.edu>2018-02-12 22:45:04 -0500
commitdf94066e3af02ff02d5ab4d033a3d603f743234c (patch)
tree168a1edaf58d386c175ffb601e9d4da8e13d31e2 /base/src/main/java/bjc/utils/data/internals/BoundLazy.java
parentae51c587c53f7ca311e556e3cbd0c5566d6c2843 (diff)
Formatting pass
Diffstat (limited to 'base/src/main/java/bjc/utils/data/internals/BoundLazy.java')
-rw-r--r--base/src/main/java/bjc/utils/data/internals/BoundLazy.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/base/src/main/java/bjc/utils/data/internals/BoundLazy.java b/base/src/main/java/bjc/utils/data/internals/BoundLazy.java
index a1c2ea0..f4e8f7e 100644
--- a/base/src/main/java/bjc/utils/data/internals/BoundLazy.java
+++ b/base/src/main/java/bjc/utils/data/internals/BoundLazy.java
@@ -32,13 +32,13 @@ public class BoundLazy<OldType, BoundContainedType> implements IHolder<BoundCont
private final IList<UnaryOperator<BoundContainedType>> actions = new FunctionalList<>();
/**
- * Create a new bound lazy value.
+ * Create a new bound lazy value.
*
* @param supp
- * The supplier of the old value.
+ * The supplier of the old value.
*
* @param binder
- * The function to use to bind the old value to the new one.
+ * 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) {
@@ -48,7 +48,7 @@ public class BoundLazy<OldType, BoundContainedType> implements IHolder<BoundCont
@Override
public <BoundType> IHolder<BoundType> bind(final Function<BoundContainedType, IHolder<BoundType>> bindr) {
- if (bindr == null) throw new NullPointerException("Binder must not be null");
+ if(bindr == null) throw new NullPointerException("Binder must not be null");
/* Prepare a list of pending actions. */
final IList<UnaryOperator<BoundContainedType>> pendingActions = new FunctionalList<>();
@@ -59,7 +59,7 @@ public class BoundLazy<OldType, BoundContainedType> implements IHolder<BoundCont
IHolder<BoundContainedType> oldHolder = boundHolder;
/* Bind the value if it hasn't been bound before. */
- if (!holderBound) {
+ if(!holderBound) {
oldHolder = oldSupplier.get().unwrap(binder);
}
@@ -75,7 +75,7 @@ public class BoundLazy<OldType, BoundContainedType> implements IHolder<BoundCont
@Override
public <NewType> Function<BoundContainedType, IHolder<NewType>> lift(
final Function<BoundContainedType, NewType> func) {
- if (func == null) throw new NullPointerException("Function to lift must not be null");
+ if(func == null) throw new NullPointerException("Function to lift must not be null");
return (val) -> {
return new Lazy<>(func.apply(val));
@@ -84,7 +84,7 @@ public class BoundLazy<OldType, BoundContainedType> implements IHolder<BoundCont
@Override
public <MappedType> IHolder<MappedType> map(final Function<BoundContainedType, MappedType> mapper) {
- if (mapper == null) throw new NullPointerException("Mapper must not be null");
+ if(mapper == null) throw new NullPointerException("Mapper must not be null");
/* Prepare a list of pending actions. */
final IList<UnaryOperator<BoundContainedType>> pendingActions = new FunctionalList<>();
@@ -95,7 +95,7 @@ public class BoundLazy<OldType, BoundContainedType> implements IHolder<BoundCont
IHolder<BoundContainedType> oldHolder = boundHolder;
/* Bound the value if it hasn't been bound. */
- if (!holderBound) {
+ if(!holderBound) {
oldHolder = oldSupplier.get().unwrap(binder);
}
@@ -110,14 +110,14 @@ public class BoundLazy<OldType, BoundContainedType> implements IHolder<BoundCont
@Override
public String toString() {
- if (holderBound) return boundHolder.toString();
+ if(holderBound) return boundHolder.toString();
return "(unmaterialized)";
}
@Override
public IHolder<BoundContainedType> transform(final UnaryOperator<BoundContainedType> transformer) {
- if (transformer == null) throw new NullPointerException("Transformer must not be null");
+ if(transformer == null) throw new NullPointerException("Transformer must not be null");
actions.add(transformer);
@@ -126,9 +126,9 @@ public class BoundLazy<OldType, BoundContainedType> implements IHolder<BoundCont
@Override
public <UnwrappedType> UnwrappedType unwrap(final Function<BoundContainedType, UnwrappedType> unwrapper) {
- if (unwrapper == null) throw new NullPointerException("Unwrapper must not be null");
+ if(unwrapper == null) throw new NullPointerException("Unwrapper must not be null");
- if (!holderBound) {
+ if(!holderBound) {
boundHolder = oldSupplier.get().unwrap(binder::apply);
}