X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2Fserialization%2FPathArgumentType.java;h=8209c9a5830e58dce8b0cf2fbb8862c61457a688;hp=58a09ae88599204a4414f9844db1bb57e032be32;hb=a58c23b491f665e6d5449e97d430a7e15d1ecda6;hpb=5adfd98dac66cab656090d1b51324b4d09573bd9 diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/PathArgumentType.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/PathArgumentType.java index 58a09ae885..8209c9a583 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/PathArgumentType.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/PathArgumentType.java @@ -8,9 +8,9 @@ package org.opendaylight.controller.cluster.datastore.node.utils.serialization; +import com.google.common.collect.ImmutableMap; import java.util.Map; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import com.google.common.collect.ImmutableMap; public enum PathArgumentType { AUGMENTATION_IDENTIFIER, @@ -19,20 +19,19 @@ public enum PathArgumentType { NODE_IDENTIFIER_WITH_PREDICATES; private static Map, PathArgumentType> CLASS_TO_ENUM_MAP = - ImmutableMap., PathArgumentType>builder(). - put(YangInstanceIdentifier.AugmentationIdentifier.class, AUGMENTATION_IDENTIFIER). - put(YangInstanceIdentifier.NodeIdentifier.class, NODE_IDENTIFIER). - put(YangInstanceIdentifier.NodeIdentifierWithPredicates.class, NODE_IDENTIFIER_WITH_PREDICATES). - put(YangInstanceIdentifier.NodeWithValue.class, NODE_IDENTIFIER_WITH_VALUE).build(); + ImmutableMap., PathArgumentType>builder() + .put(YangInstanceIdentifier.AugmentationIdentifier.class, AUGMENTATION_IDENTIFIER) + .put(YangInstanceIdentifier.NodeIdentifier.class, NODE_IDENTIFIER) + .put(YangInstanceIdentifier.NodeIdentifierWithPredicates.class, NODE_IDENTIFIER_WITH_PREDICATES) + .put(YangInstanceIdentifier.NodeWithValue.class, NODE_IDENTIFIER_WITH_VALUE).build(); - public static int getSerializablePathArgumentType(YangInstanceIdentifier.PathArgument pathArgument){ + public static int getSerializablePathArgumentType(YangInstanceIdentifier.PathArgument pathArgument) { PathArgumentType type = CLASS_TO_ENUM_MAP.get(pathArgument.getClass()); - if(type == null) { + if (type == null) { throw new IllegalArgumentException("Unknown type of PathArgument = " + pathArgument); } return type.ordinal(); } - }