Merge "Increase test coverage for vid/aii - third part"
[vid.git] / vid-app-common / src / main / java / org / onap / vid / aai / model / VnfResult.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 AT&T 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
21 package org.onap.vid.aai.model;
22
23 import com.fasterxml.jackson.annotation.*;
24
25 import java.util.HashMap;
26 import java.util.List;
27 import java.util.Map;
28 import java.util.Objects;
29
30
31 @JsonInclude(JsonInclude.Include.NON_NULL)
32 @JsonPropertyOrder({
33         "id",
34         "node-type",
35         "url",
36         "properties",
37         "related-to"
38 })
39 public class VnfResult {
40     @JsonProperty("id")
41     public String id;
42     @JsonProperty("node-type")
43     public String nodeType;
44     @JsonProperty("url")
45     public String url;
46     @JsonProperty("properties")
47     public ServiceProperties properties;
48     @JsonProperty("related-to")
49     public List<RelatedTo> relatedTo = null;
50     @JsonIgnore
51     private Map<String, Object> additionalProperties = new HashMap<>();
52
53     @JsonProperty("id")
54     public void setJsonId(String id) {
55         this.id = id;
56     }
57
58     @JsonProperty("node-type")
59     public void setJsonNodeType(String nodeType) {
60         this.nodeType = nodeType;
61     }
62
63     @JsonProperty("url")
64     public void setJsonUrl(String url) {
65         this.url = url;
66     }
67
68     @JsonProperty("properties")
69     public void setJsonProperties(ServiceProperties properties) {
70         this.properties = properties;
71     }
72
73     @JsonProperty("related-to")
74     public void setJsonRelatedTo(List<RelatedTo> relatedTo) {
75         this.relatedTo = relatedTo;
76     }
77
78     @JsonAnyGetter
79     public Map<String, Object> getAdditionalProperties() {
80         return this.additionalProperties;
81     }
82
83     @JsonAnySetter
84     public void setJsonAdditionalProperty(String name, Object value) {
85         this.additionalProperties.put(name, value);
86     }
87
88     @Override
89     public boolean equals(Object o) {
90         if (this == o) return true;
91         if (o == null || getClass() != o.getClass()) return false;
92         VnfResult vnfResult = (VnfResult) o;
93         return Objects.equals(id, vnfResult.id) &&
94                 Objects.equals(nodeType, vnfResult.nodeType) &&
95                 Objects.equals(url, vnfResult.url) &&
96                 Objects.equals(properties, vnfResult.properties) &&
97                 Objects.equals(relatedTo, vnfResult.relatedTo) &&
98                 Objects.equals(additionalProperties, vnfResult.additionalProperties);
99     }
100
101     @Override
102     public int hashCode() {
103         return Objects.hash(id, nodeType, url, properties, relatedTo, additionalProperties);
104     }
105 }