diff options
author | 2016-06-02 13:23:39 +0200 | |
---|---|---|
committer | 2016-06-06 12:52:33 +0000 | |
commit | 2da2d410e5bd679b356b079972b441695c353833 (patch) | |
tree | 606c630e72af772aedfbe48a67c8d8dc28206718 /v3po/vpp-translate-utils/src/main | |
parent | f6df9d5f3456e8bd2c355a9ae852ef2ecf75e6b5 (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/src/main')
-rw-r--r-- | v3po/vpp-translate-utils/src/main/java/io/fd/honeycomb/v3po/translate/v3po/util/NamingContext.java | 14 |
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 |