From 504ca816530efdff06bc202e0432ebd354aec304 Mon Sep 17 00:00:00 2001 From: EVE Date: Tue, 14 Mar 2017 12:07:14 -0400 Subject: Cleanup --- .../java/bjc/utils/funcdata/FunctionalMap.java | 31 ++++++++-------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalMap.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalMap.java b/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalMap.java index 3d3fed1..10a727c 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalMap.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcdata/FunctionalMap.java @@ -1,16 +1,16 @@ package bjc.utils.funcdata; +import bjc.utils.data.IPair; + import java.util.HashMap; import java.util.Map; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Function; -import bjc.utils.data.IPair; - /** * Basic implementation of {@link IMap} - * + * * @author ben * * @param @@ -30,7 +30,7 @@ public class FunctionalMap implements IMap implements IMap... entries) { this(); - for (IPair entry : entries) { + for(IPair entry : entries) { entry.doWith((key, val) -> { wrappedMap.put(key, val); }); @@ -47,14 +47,12 @@ public class FunctionalMap implements IMap wrap) { - if (wrap == null) { - throw new NullPointerException("Map to wrap must not be null"); - } + if(wrap == null) throw new NullPointerException("Map to wrap must not be null"); wrappedMap = wrap; } @@ -91,13 +89,10 @@ public class FunctionalMap implements IMap implements IMap IMap mapValues(Function transformer) { - if (transformer == null) { - throw new NullPointerException("Transformer must not be null"); - } + if(transformer == null) throw new NullPointerException("Transformer must not be null"); return new TransformedValueMap<>(this, transformer); } @Override public ValueType put(KeyType key, ValueType val) { - if (key == null) { - throw new NullPointerException("Key must not be null"); - } + if(key == null) throw new NullPointerException("Key must not be null"); return wrappedMap.put(key, val); } -- cgit v1.2.3