X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2Fserialization%2FPathArgumentType.java;fp=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2Fserialization%2FPathArgumentType.java;h=0000000000000000000000000000000000000000;hb=599f10fc4a52c41583b719582b6ff36a0d53ccae;hp=8209c9a5830e58dce8b0cf2fbb8862c61457a688;hpb=a58c23b491f665e6d5449e97d430a7e15d1ecda6;p=controller.git 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 deleted file mode 100644 index 8209c9a583..0000000000 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/PathArgumentType.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -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; - -public enum PathArgumentType { - AUGMENTATION_IDENTIFIER, - NODE_IDENTIFIER, - NODE_IDENTIFIER_WITH_VALUE, - 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(); - - public static int getSerializablePathArgumentType(YangInstanceIdentifier.PathArgument pathArgument) { - - PathArgumentType type = CLASS_TO_ENUM_MAP.get(pathArgument.getClass()); - if (type == null) { - throw new IllegalArgumentException("Unknown type of PathArgument = " + pathArgument); - } - - return type.ordinal(); - } -}