blob: 2d24dc4d20be33ce8b05f38ba3b145ec998dd85c [file] [log] [blame]
hirokiec18d3a2018-05-16 15:27:37 -07001/*
2 * Copyright 2018-present Open Networking Foundation
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
17package org.onosproject.odtn.utils.tapi;
18
19import org.onosproject.yang.gen.v1.tapicommon.rev20180307.tapicommon.DefaultContext;
20import org.onosproject.yang.gen.v1.tapicommon.rev20180307.tapicommon.Uuid;
21import org.onosproject.yang.model.ModelObject;
22import org.onosproject.yang.model.ModelObjectData;
23import org.onosproject.yang.model.ModelObjectId;
24
25/**
26 * Utility builder class for TAPI context creation with DCS.
27 */
28public final class TapiContextBuilder extends TapiInstanceBuilder {
29
30 private DefaultContext context;
31
32 private TapiContextBuilder(DefaultContext context) {
33 this.context = context;
34 }
35
36 public static TapiContextBuilder builder(DefaultContext context) {
37 return new TapiContextBuilder(context);
38 }
39
40 @Override
41 public ModelObjectData build() {
42 ModelObjectId objId = ModelObjectId.builder().build();
43 return getModelObjectData(context, objId);
44 }
45
46 @Override
47 public ModelObject getModelObject() {
48 return context;
49 }
50
51 @Override
52 public Uuid getUuid() {
53 return null;
54 }
55}