2 * Copyright (c) 2018 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.dom.adapter;
10 import static java.util.Objects.requireNonNull;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.concepts.Delegator;
15 abstract class AbstractBindingAdapter<T> implements Delegator<T> {
16 private final @NonNull AdapterContext adapterContext;
17 private final @NonNull T delegate;
19 AbstractBindingAdapter(final AdapterContext adapterContext, final T delegate) {
20 this.adapterContext = requireNonNull(adapterContext);
21 this.delegate = requireNonNull(delegate);
25 public final T getDelegate() {
29 protected final @NonNull AdapterContext adapterContext() {
30 return adapterContext;
33 protected final @NonNull CurrentAdapterSerializer currentSerializer() {
34 return adapterContext.currentSerializer();