23cb5cd8c7850d0e589691772bc8c87d4d1fb80d
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / BindingDOMAdapterBuilder.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.md.sal.binding.impl;
9
10 import com.google.common.base.Preconditions;
11 import com.google.common.collect.ClassToInstanceMap;
12 import org.opendaylight.controller.md.sal.binding.api.BindingService;
13 import org.opendaylight.controller.md.sal.binding.spi.AdapterBuilder;
14 import org.opendaylight.controller.md.sal.dom.api.DOMService;
15
16 @Deprecated
17 abstract class BindingDOMAdapterBuilder<T extends BindingService> extends AdapterBuilder<T, DOMService> {
18
19     interface Factory<T extends BindingService> {
20
21         BindingDOMAdapterBuilder<T> newBuilder();
22
23     }
24
25     private BindingToNormalizedNodeCodec codec;
26
27     public void setCodec(final BindingToNormalizedNodeCodec codec) {
28         this.codec = codec;
29     }
30
31     @Override
32     protected final T createInstance(final ClassToInstanceMap<DOMService> delegates) {
33         Preconditions.checkState(codec != null);
34         return createInstance(codec,delegates);
35     }
36
37     protected abstract T createInstance(BindingToNormalizedNodeCodec codec2, ClassToInstanceMap<DOMService> delegates);
38
39 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.