Hide CodecContext methods
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / CaseCodecContext.java
index fb3a59b1246f9b4370682e541d1b74f1b64cb854..fb7836042dbe6dc289b0d8daa1782330bd833709 100644 (file)
@@ -7,23 +7,21 @@
  */
 package org.opendaylight.mdsal.binding.dom.codec.impl;
 
-import static com.google.common.base.Preconditions.checkArgument;
-
 import java.util.List;
 import org.opendaylight.mdsal.binding.runtime.api.CaseRuntimeType;
 import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.DataObjectStep;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 final class CaseCodecContext<D extends DataObject> extends DataObjectCodecContext<D, CaseRuntimeType> {
     CaseCodecContext(final CaseCodecPrototype prototype) {
-        super(prototype, CodecItemFactory.of(prototype.getBindingClass()));
+        super(prototype, CodecItemFactory.of(prototype.javaClass()));
     }
 
     @Override
-    void addYangPathArgument(final List<YangInstanceIdentifier.PathArgument> builder, final PathArgument arg) {
+    void addYangPathArgument(final List<PathArgument> builder, final DataObjectStep<?> step) {
         // NOOP
     }
 
@@ -33,19 +31,18 @@ final class CaseCodecContext<D extends DataObject> extends DataObjectCodecContex
     }
 
     @Override
-    protected Object deserializeObject(final NormalizedNode normalizedNode) {
-        return deserialize(normalizedNode);
-    }
-
-    @Override
-    public YangInstanceIdentifier.PathArgument serializePathArgument(final PathArgument arg) {
-        checkArgument(arg == null, "Unexpected argument %s", arg);
+    public PathArgument serializePathArgument(final DataObjectStep<?> step) {
+        if (step != null) {
+            throw new IllegalArgumentException("Unexpected argument " + step);
+        }
         return null;
     }
 
     @Override
-    public PathArgument deserializePathArgument(final YangInstanceIdentifier.PathArgument arg) {
-        checkArgument(arg == null, "Unexpected argument %s", arg);
+    public DataObjectStep<?> deserializePathArgument(final PathArgument arg) {
+        if (arg != null) {
+            throw new IllegalArgumentException("Unexpected argument " + arg);
+        }
         return null;
     }
 }