Add simplified local setup
[aai/test-config.git] / local-setup / src / main / java / onap / aai / dto / Model.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2018-2019 Nokia Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *    http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20 package onap.aai.dto;
21
22 import java.util.Arrays;
23 import java.util.List;
24
25 /**
26  * Dummy model for testing purposes
27  */
28 @SuppressWarnings("unused")
29 public class Model {
30
31     private static final String MODEL_TYPE = "widget";
32     private static final String MODEL_VERSION = "1.0";
33
34     private final String modelInvariantId;
35     private final String modelType;
36     private final ModelVers modelVers;
37
38     public Model(String modelName, String modelInvariantId, String modelVersionId) {
39         this.modelInvariantId = modelInvariantId;
40         this.modelVers = new ModelVers(new ModelVer(modelVersionId, modelName));
41         this.modelType = MODEL_TYPE;
42     }
43
44     public String getModelInvariantId() {
45         return modelInvariantId;
46     }
47
48     public ModelVers getModelVers() {
49         return modelVers;
50     }
51
52     public String getModelType() {
53         return modelType;
54     }
55
56     private static class ModelVers {
57
58         private final List<ModelVer> modelVer;
59
60         ModelVers(ModelVer... modelVer) {
61             this.modelVer = Arrays.asList(modelVer);
62         }
63
64         public List<ModelVer> getModelVer() {
65             return modelVer;
66         }
67     }
68
69     private static class ModelVer {
70
71         private final String modelVersionId;
72         private final String modelVersion;
73         private final String modelName;
74
75         ModelVer(String modelVersionId, String modelName) {
76             this.modelVersionId = modelVersionId;
77             this.modelName = modelName;
78             this.modelVersion = MODEL_VERSION;
79         }
80
81         public String getModelVersionId() {
82             return modelVersionId;
83         }
84
85         public String getModelName() {
86             return modelName;
87         }
88
89         public String getModelVersion() {
90             return MODEL_VERSION;
91         }
92     }
93 }