69b8c95bf7d43353bc08687bc010901d5918b162
[honeycomb.git] / v3po / v3po2vpp / src / main / java / io / fd / honeycomb / translate / v3po / interfacesstate / pbb / PbbRewriteStateCustomizer.java
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package io.fd.honeycomb.translate.v3po.interfacesstate.pbb;
18
19 import io.fd.honeycomb.translate.read.ReadContext;
20 import io.fd.honeycomb.translate.read.ReadFailedException;
21 import io.fd.honeycomb.translate.spi.read.ReaderCustomizer;
22 import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
23 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
24 import javax.annotation.Nonnull;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.pbb.rev161214.PbbRewriteStateInterfaceAugmentationBuilder;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.pbb.rev161214.interfaces.state._interface.PbbRewriteState;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.pbb.rev161214.interfaces.state._interface.PbbRewriteStateBuilder;
28 import org.opendaylight.yangtools.concepts.Builder;
29 import org.opendaylight.yangtools.yang.binding.DataObject;
30 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
31
32 public class PbbRewriteStateCustomizer extends FutureJVppCustomizer
33         implements ReaderCustomizer<PbbRewriteState, PbbRewriteStateBuilder> {
34
35     public PbbRewriteStateCustomizer(@Nonnull final FutureJVppCore futureJVppCore) {
36         super(futureJVppCore);
37     }
38
39     @Nonnull
40     @Override
41     public PbbRewriteStateBuilder getBuilder(@Nonnull final InstanceIdentifier<PbbRewriteState> id) {
42         return new PbbRewriteStateBuilder();
43     }
44
45     @Override
46     public void readCurrentAttributes(@Nonnull final InstanceIdentifier<PbbRewriteState> id,
47                                       @Nonnull final PbbRewriteStateBuilder builder, @Nonnull final ReadContext ctx)
48             throws ReadFailedException {
49         //TODO implement read after https://jira.fd.io/browse/VPP-468 + init
50     }
51
52     @Override
53     public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder,
54                       @Nonnull final PbbRewriteState readValue) {
55         ((PbbRewriteStateInterfaceAugmentationBuilder) parentBuilder).setPbbRewriteState(readValue);
56     }
57 }