/* * Copyright (c) 2015 Cisco Systems, Inc. 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 com.google.common.base.Preconditions; import com.google.common.collect.ClassToInstanceMap; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.binding.api.BindingService; import org.opendaylight.mdsal.dom.api.DOMService; abstract class BindingDOMAdapterBuilder extends AdapterBuilder { @FunctionalInterface interface Factory { BindingDOMAdapterBuilder newBuilder(); } private BindingToNormalizedNodeCodec codec; void setCodec(final BindingToNormalizedNodeCodec codec) { this.codec = codec; } @Override protected final T createInstance(final ClassToInstanceMap delegates) { Preconditions.checkState(codec != null); return createInstance(codec, delegates); } abstract T createInstance(BindingToNormalizedNodeCodec myCodec, @NonNull ClassToInstanceMap<@NonNull DOMService> delegates); }