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.InstanceIdentifier.Item;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
17 abstract sealed class CommonDataObjectCodecPrototype<T extends CompositeRuntimeType>
18 extends LazyCodecContextSupplier<CommonDataObjectCodecContext<?, T>>
19 permits AugmentationCodecPrototype, DataObjectCodecPrototype {
20 private final @NonNull T type;
21 private final @NonNull CodecContextFactory factory;
22 private final @NonNull Item<?> bindingArg;
24 CommonDataObjectCodecPrototype(final Item<?> bindingArg, final T type, final CodecContextFactory factory) {
25 this.bindingArg = requireNonNull(bindingArg);
26 this.type = requireNonNull(type);
27 this.factory = requireNonNull(factory);
30 final @NonNull T getType() {
34 final @NonNull CodecContextFactory getFactory() {
38 final @NonNull Class<?> getBindingClass() {
39 return bindingArg.getType();
42 final @NonNull Item<?> getBindingArg() {
46 abstract @NonNull NodeIdentifier getYangArg();