summaryrefslogtreecommitdiffstats
path: root/v3po/vpp-translate-utils
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-06-02 13:23:39 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-06-06 12:52:33 +0000
commit303c10fd52abfbeeeb17a94b3b502d539e9197ac (patch)
tree41bc38400138a6e956e34428f48d8dfe22db0d4d /v3po/vpp-translate-utils
parent64c12426da9aaf583a0262783b8bc5a1674f7081 (diff)
Intializers for the new vlan model
Change-Id: I513f0b190e9d9e669663a9a216e7c72b1ebeb10d Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/vpp-translate-utils')
-rw-r--r--v3po/vpp-translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/v3po/util/NamingContext.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/v3po/vpp-translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/v3po/util/NamingContext.java b/v3po/vpp-translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/v3po/util/NamingContext.java
index 34c810462..bcc980dd4 100644
--- a/v3po/vpp-translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/v3po/util/NamingContext.java
+++ b/v3po/vpp-translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/v3po/util/NamingContext.java
@@ -21,8 +21,8 @@ import static com.google.common.base.Preconditions.checkState;
import com.google.common.base.Optional;
import io.fd.honeycomb.v3po.translate.MappingContext;
+import io.fd.honeycomb.v3po.translate.util.RWUtils;
import java.util.stream.Collector;
-import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.Contexts;
import org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContextKey;
@@ -47,17 +47,7 @@ public final class NamingContext implements AutoCloseable {
private final KeyedInstanceIdentifier<org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.naming.context.rev160513.contexts.NamingContext, NamingContextKey>
namingContextIid;
- /**
- * Collector expecting only a single resulting item from a stream
- */
- private static final Collector<Mapping, ?, Mapping> SINGLE_ITEM_COLLECTOR = Collectors.collectingAndThen(
- Collectors.toList(),
- list -> {
- if (list.size() != 1) {
- throw new IllegalStateException("Unexpected size of list: " + list + ". Single item expected");
- }
- return list.get(0);
- });
+ private static final Collector<Mapping, ?, Mapping> SINGLE_ITEM_COLLECTOR = RWUtils.singleItemCollector();
/**
* Create new naming context