/* * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.mdsal.binding.dom.adapter; import static java.util.Objects.requireNonNull; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.concepts.Delegator; abstract class AbstractBindingAdapter implements Delegator { private final @NonNull AdapterContext adapterContext; private final @NonNull T delegate; AbstractBindingAdapter(final AdapterContext adapterContext, final T delegate) { this.adapterContext = requireNonNull(adapterContext); this.delegate = requireNonNull(delegate); } @Override public final T getDelegate() { return delegate; } protected final @NonNull AdapterContext adapterContext() { return adapterContext; } protected final @NonNull CurrentAdapterSerializer currentSerializer() { return adapterContext.currentSerializer(); } }