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.NonNullByDefault;
13 import org.opendaylight.yangtools.concepts.Delegator;
16 abstract class AbstractBindingAdapter<T> implements Delegator<T> {
17 private final AdapterContext adapterContext;
18 private final T delegate;
20 AbstractBindingAdapter(final AdapterContext adapterContext, final T delegate) {
21 this.adapterContext = requireNonNull(adapterContext);
22 this.delegate = requireNonNull(delegate);
26 public final T getDelegate() {
30 protected final AdapterContext adapterContext() {
31 return adapterContext;
34 protected final CurrentAdapterSerializer currentSerializer() {
35 return adapterContext.currentSerializer();