2 * Copyright (c) 2023 PANTHEON.tech, 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.dom.codec.impl;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.collect.ImmutableSet;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.mdsal.binding.runtime.api.AugmentRuntimeType;
15 import org.opendaylight.yangtools.binding.lib.Augmentation;
16 import org.opendaylight.yangtools.binding.lib.NodeStep;
17 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
19 final class AugmentationCodecPrototype<T extends Augmentation<?>>
20 extends CommonDataObjectCodecPrototype<AugmentRuntimeType> {
21 private final @NonNull ImmutableSet<NodeIdentifier> childArgs;
23 AugmentationCodecPrototype(final @NonNull Class<T> cls, final AugmentRuntimeType type,
24 final CodecContextFactory factory, final ImmutableSet<NodeIdentifier> childArgs) {
25 super(new NodeStep<>(cls), type, factory);
26 this.childArgs = requireNonNull(childArgs);
30 NodeIdentifier yangArg() {
31 throw new UnsupportedOperationException("Augmentation does not have PathArgument address");
35 AugmentationCodecContext<?> createInstance() {
36 return new AugmentationCodecContext<>(this);
39 // Guaranteed to be non-empty
40 @NonNull ImmutableSet<NodeIdentifier> getChildArgs() {