Merge "Feature toggle for owning-entities filtering"
[vid.git] / vid-app-common / src / main / java / org / onap / vid / aai / OperationalEnvironment.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
6  * Modifications Copyright (C) 2019 Nokia.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.vid.aai;
23
24 import static com.fasterxml.jackson.annotation.JsonProperty.Access.WRITE_ONLY;
25
26 import com.fasterxml.jackson.annotation.JsonCreator;
27 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
28 import com.fasterxml.jackson.annotation.JsonProperty;
29 import org.onap.vid.aai.model.RelationshipList;
30
31 @JsonIgnoreProperties(ignoreUnknown = true)
32 public final class OperationalEnvironment {
33
34     private final String operationalEnvironmentId;
35     private final String operationalEnvironmentName;
36     private final String operationalEnvironmentType;
37     private final String operationalEnvironmentStatus;
38     private final String tenantContext;
39     private final String workloadContext;
40     private final String resourceVersion;
41     private final RelationshipList relationshipList;
42
43     public static OperationalEnvironmentBuilder builder() {
44         return new OperationalEnvironmentBuilder();
45     }
46
47     @JsonCreator
48     OperationalEnvironment(
49         @JsonProperty(value = "operational-environment-id", access = WRITE_ONLY) String operationalEnvironmentId,
50         @JsonProperty(value = "operational-environment-name", access = WRITE_ONLY) String operationalEnvironmentName,
51         @JsonProperty(value = "operational-environment-type", access = WRITE_ONLY) String operationalEnvironmentType,
52         @JsonProperty(value = "operational-environment-status", access = WRITE_ONLY) String operationalEnvironmentStatus,
53         @JsonProperty(value = "tenant-context", access = WRITE_ONLY) String tenantContext,
54         @JsonProperty(value = "workload-context", access = WRITE_ONLY) String workloadContext,
55         @JsonProperty(value = "resource-version", access = WRITE_ONLY) String resourceVersion,
56         @JsonProperty(value = "relationship-list", access = WRITE_ONLY) RelationshipList relationshipList) {
57         this.operationalEnvironmentId = operationalEnvironmentId;
58         this.operationalEnvironmentName = operationalEnvironmentName;
59         this.operationalEnvironmentType = operationalEnvironmentType;
60         this.operationalEnvironmentStatus = operationalEnvironmentStatus;
61         this.tenantContext = tenantContext;
62         this.workloadContext = workloadContext;
63         this.resourceVersion = resourceVersion;
64         this.relationshipList = relationshipList;
65     }
66
67     public String getOperationalEnvironmentId() {
68         return operationalEnvironmentId;
69     }
70
71     public String getOperationalEnvironmentName() {
72         return operationalEnvironmentName;
73     }
74
75     public String getOperationalEnvironmentType() {
76         return operationalEnvironmentType;
77     }
78
79     public String getOperationalEnvironmentStatus() {
80         return operationalEnvironmentStatus;
81     }
82
83     public String getTenantContext() {
84         return tenantContext;
85     }
86
87     public String getWorkloadContext() {
88         return workloadContext;
89     }
90
91     public String getResourceVersion() {
92         return resourceVersion;
93     }
94
95     public RelationshipList getRelationshipList() {
96         return relationshipList;
97     }
98
99     public static class OperationalEnvironmentBuilder {
100
101         private String operationalEnvironmentId;
102         private String operationalEnvironmentName;
103         private String operationalEnvironmentType;
104         private String operationalEnvironmentStatus;
105         private String tenantContext;
106         private String workloadContext;
107         private String resourceVersion;
108
109         private RelationshipList relationshipList;
110
111         public OperationalEnvironmentBuilder withOperationalEnvironmentId(
112             String operationalEnvironmentId) {
113             this.operationalEnvironmentId = operationalEnvironmentId;
114             return this;
115         }
116
117         public OperationalEnvironmentBuilder withOperationalEnvironmentName(
118             String operationalEnvironmentName) {
119             this.operationalEnvironmentName = operationalEnvironmentName;
120             return this;
121         }
122
123         public OperationalEnvironmentBuilder withOperationalEnvironmentType(
124             String operationalEnvironmentType) {
125             this.operationalEnvironmentType = operationalEnvironmentType;
126             return this;
127         }
128
129         public OperationalEnvironmentBuilder withOperationalEnvironmentStatus(
130             String operationalEnvironmentStatus) {
131             this.operationalEnvironmentStatus = operationalEnvironmentStatus;
132             return this;
133         }
134
135         public OperationalEnvironmentBuilder withTenantContext(String tenantContext) {
136             this.tenantContext = tenantContext;
137             return this;
138         }
139
140         public OperationalEnvironmentBuilder withWorkloadContext(String workloadContext) {
141             this.workloadContext = workloadContext;
142             return this;
143         }
144
145         public OperationalEnvironmentBuilder withResourceVersion(String resourceVersion) {
146             this.resourceVersion = resourceVersion;
147             return this;
148         }
149
150         public OperationalEnvironmentBuilder withRelationshipList(
151             RelationshipList relationshipList) {
152             this.relationshipList = relationshipList;
153             return this;
154         }
155
156         public OperationalEnvironment build() {
157             return new OperationalEnvironment(operationalEnvironmentId,
158                 operationalEnvironmentName,
159                 operationalEnvironmentType,
160                 operationalEnvironmentStatus,
161                 tenantContext,
162                 workloadContext,
163                 resourceVersion,
164                 relationshipList);
165         }
166
167     }
168
169 }