Bug 2364: Migrated Binding MD-SAL to not use composites nodes
[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 abstract class BindingDOMAdapterBuilder<T extends BindingService> extends AdapterBuilder<T, DOMService> {
17
18     interface Factory<T extends BindingService> {
19
20         BindingDOMAdapterBuilder<T> newBuilder();
21
22     }
23
24     private BindingToNormalizedNodeCodec codec;
25
26     public void setCodec(final BindingToNormalizedNodeCodec codec) {
27         this.codec = codec;
28     }
29
30     @Override
31     protected final T createInstance(final ClassToInstanceMap<DOMService> delegates) {
32         Preconditions.checkState(codec != null);
33         return createInstance(codec,delegates);
34     }
35
36     protected abstract T createInstance(BindingToNormalizedNodeCodec codec2, ClassToInstanceMap<DOMService> delegates);
37
38 }

©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.