2 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.javav2.dom.codec.impl.context;
10 import com.google.common.annotations.Beta;
11 import com.google.common.base.Preconditions;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.mdsal.binding.javav2.dom.codec.impl.context.base.DataContainerCodecPrototype;
14 import org.opendaylight.mdsal.binding.javav2.dom.codec.impl.context.base.TreeNodeCodecContext;
15 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
16 import org.opendaylight.mdsal.binding.javav2.spec.structural.Augmentation;
17 import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode;
18 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
22 * Context for prototype of augmentation node.
25 public final class AugmentationNodeContext<D extends TreeNode & Augmentation<?>>
26 extends TreeNodeCodecContext<D, AugmentationSchema> {
29 * Prepare context for augmentation node from prototype.
32 * - codec prototype of augmentation node
34 public AugmentationNodeContext(final DataContainerCodecPrototype<AugmentationSchema> prototype) {
40 public D deserialize(@Nonnull final NormalizedNode<?, ?> normalizedNode) {
41 Preconditions.checkArgument(normalizedNode instanceof AugmentationNode);
42 return createBindingProxy((AugmentationNode) normalizedNode);
46 protected Object deserializeObject(final NormalizedNode<?, ?> normalizedNode) {
47 return deserialize(normalizedNode);