Rename PathArgumentTypes to LithiumPathArgument 61/84561/3
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 20 Sep 2019 17:55:39 +0000 (19:55 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 23 Sep 2019 08:45:32 +0000 (10:45 +0200)
These tokens are only used in Lithium-based streams, but the global
name is slightly confusing. Rename to LithiumPathArgument, which
makes the context more obvious.

JIRA: CONTROLLER-1919
Change-Id: I2b92be4c469de8dffba6e071449b5ae947b9ace8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataInput.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataOutput.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumPathArgument.java [moved from opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/PathArgumentTypes.java with 96% similarity]

index c360aecfc512fa8d8eac2060d71f33afb90e0c2d..e2637482653e516d4ebffd6f616cd1ca93bb91c8 100644 (file)
@@ -429,13 +429,13 @@ abstract class AbstractLithiumDataInput extends AbstractNormalizedNodeDataInput
         int type = input.readByte();
 
         switch (type) {
         int type = input.readByte();
 
         switch (type) {
-            case PathArgumentTypes.AUGMENTATION_IDENTIFIER:
+            case LithiumPathArgument.AUGMENTATION_IDENTIFIER:
                 return readAugmentationIdentifier();
                 return readAugmentationIdentifier();
-            case PathArgumentTypes.NODE_IDENTIFIER:
+            case LithiumPathArgument.NODE_IDENTIFIER:
                 return readNodeIdentifier();
                 return readNodeIdentifier();
-            case PathArgumentTypes.NODE_IDENTIFIER_WITH_PREDICATES:
+            case LithiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES:
                 return readNormalizedNodeWithPredicates();
                 return readNormalizedNodeWithPredicates();
-            case PathArgumentTypes.NODE_IDENTIFIER_WITH_VALUE:
+            case LithiumPathArgument.NODE_IDENTIFIER_WITH_VALUE:
                 return new NodeWithValue<>(readQName(), readObject());
             default:
                 // FIXME: throw hard error
                 return new NodeWithValue<>(readQName(), readObject());
             default:
                 // FIXME: throw hard error
index be61f7847dc34a7d9de038f6d89077b00a2261ff..47082698f98b622dac1f1496f170711194b0ca12 100644 (file)
@@ -215,26 +215,26 @@ abstract class AbstractLithiumDataOutput extends AbstractNormalizedNodeDataOutpu
     @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST",
             justification = "The casts in the switch clauses are indirectly confirmed via the determination of 'type'.")
     final void writePathArgumentInternal(final PathArgument pathArgument) throws IOException {
     @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST",
             justification = "The casts in the switch clauses are indirectly confirmed via the determination of 'type'.")
     final void writePathArgumentInternal(final PathArgument pathArgument) throws IOException {
-        final byte type = PathArgumentTypes.getSerializablePathArgumentType(pathArgument);
+        final byte type = LithiumPathArgument.getSerializablePathArgumentType(pathArgument);
         output.writeByte(type);
 
         switch (type) {
         output.writeByte(type);
 
         switch (type) {
-            case PathArgumentTypes.NODE_IDENTIFIER:
+            case LithiumPathArgument.NODE_IDENTIFIER:
                 NodeIdentifier nodeIdentifier = (NodeIdentifier) pathArgument;
                 writeQNameInternal(nodeIdentifier.getNodeType());
                 break;
                 NodeIdentifier nodeIdentifier = (NodeIdentifier) pathArgument;
                 writeQNameInternal(nodeIdentifier.getNodeType());
                 break;
-            case PathArgumentTypes.NODE_IDENTIFIER_WITH_PREDICATES:
+            case LithiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES:
                 NodeIdentifierWithPredicates nodeIdentifierWithPredicates =
                     (NodeIdentifierWithPredicates) pathArgument;
                 writeQNameInternal(nodeIdentifierWithPredicates.getNodeType());
                 writeKeyValueMap(nodeIdentifierWithPredicates.entrySet());
                 break;
                 NodeIdentifierWithPredicates nodeIdentifierWithPredicates =
                     (NodeIdentifierWithPredicates) pathArgument;
                 writeQNameInternal(nodeIdentifierWithPredicates.getNodeType());
                 writeKeyValueMap(nodeIdentifierWithPredicates.entrySet());
                 break;
-            case PathArgumentTypes.NODE_IDENTIFIER_WITH_VALUE:
+            case LithiumPathArgument.NODE_IDENTIFIER_WITH_VALUE:
                 NodeWithValue<?> nodeWithValue = (NodeWithValue<?>) pathArgument;
                 writeQNameInternal(nodeWithValue.getNodeType());
                 writeObject(nodeWithValue.getValue());
                 break;
                 NodeWithValue<?> nodeWithValue = (NodeWithValue<?>) pathArgument;
                 writeQNameInternal(nodeWithValue.getNodeType());
                 writeObject(nodeWithValue.getValue());
                 break;
-            case PathArgumentTypes.AUGMENTATION_IDENTIFIER:
+            case LithiumPathArgument.AUGMENTATION_IDENTIFIER:
                 // No Qname in augmentation identifier
                 writeAugmentationIdentifier((AugmentationIdentifier) pathArgument);
                 break;
                 // No Qname in augmentation identifier
                 writeAugmentationIdentifier((AugmentationIdentifier) pathArgument);
                 break;
@@ -17,13 +17,13 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdent
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 
-final class PathArgumentTypes {
+final class LithiumPathArgument {
     static final byte AUGMENTATION_IDENTIFIER = 1;
     static final byte NODE_IDENTIFIER = 2;
     static final byte NODE_IDENTIFIER_WITH_VALUE = 3;
     static final byte NODE_IDENTIFIER_WITH_PREDICATES = 4;
 
     static final byte AUGMENTATION_IDENTIFIER = 1;
     static final byte NODE_IDENTIFIER = 2;
     static final byte NODE_IDENTIFIER_WITH_VALUE = 3;
     static final byte NODE_IDENTIFIER_WITH_PREDICATES = 4;
 
-    private PathArgumentTypes() {
+    private LithiumPathArgument() {
         throw new UnsupportedOperationException("Utility class");
     }
 
         throw new UnsupportedOperationException("Utility class");
     }