import com.google.common.annotations.Beta;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.BindingObject;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
/**
* @param <T> Binding representation of data
*/
@Beta
-public interface BindingNormalizedNodeCodec<T extends DataObject> {
+public interface BindingNormalizedNodeCodec<T extends BindingObject> {
/**
* Converts from Normalized Node to Binding representation of data.
*
--- /dev/null
+/*
+ * Copyright (c) 2019 PANTHEON.tech, s.r.o. 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.mdsal.binding.dom.codec.api;
+
+import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.binding.TypeObject;
+
+@Beta
+public interface BindingTypeObjectCodecTreeNode<T extends TypeObject> extends BindingObjectCodecTreeNode<T>,
+ BindingNormalizedNodeCodec<T> {
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2015 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.mdsal.binding.dom.codec.impl;
+
+import org.opendaylight.yangtools.yang.binding.TypeObject;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
+
+/**
+ * A cache of NormalizedNodes corresponding to a particular TypeObject instantiation.
+ */
+final class TypeObjectNormalizedNodeCache
+ extends AbstractBindingNormalizedNodeCache<TypeObject, LeafNodeCodecContext> {
+ TypeObjectNormalizedNodeCache(final LeafNodeCodecContext rootContext) {
+ super(rootContext);
+ }
+
+ @Override
+ public NormalizedNode<?, ?> load(final TypeObject key) {
+ return ImmutableNodes.leafNode(rootContext().getDomPathArgument(),
+ rootContext().getValueCodec().serialize(key));
+ }
+}