2 * Copyright (c) 2014 Cisco Systems, Inc. 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.dom.codec.impl;
10 import static java.util.Objects.requireNonNull;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.mdsal.binding.runtime.api.CompositeRuntimeType;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.Item;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
19 * Common superclass for {@link DataObjectCodecPrototype} and {@link AugmentationCodecPrototype}.
21 * @param <R> {@link CompositeRuntimeType} type
23 abstract sealed class CommonDataObjectCodecPrototype<R extends CompositeRuntimeType>
24 extends DataContainerPrototype<CommonDataObjectCodecContext<?, R>, R>
25 permits AugmentationCodecPrototype, DataObjectCodecPrototype {
26 private final @NonNull Item<?> bindingArg;
28 CommonDataObjectCodecPrototype(final Item<?> bindingArg, final R runtimeType, final CodecContextFactory factory) {
29 super(factory, runtimeType);
30 this.bindingArg = requireNonNull(bindingArg);
34 final Class<? extends DataObject> javaClass() {
35 return bindingArg.getType();
38 final @NonNull Item<?> getBindingArg() {
42 abstract @NonNull NodeIdentifier getYangArg();