Merge "Increase test coverage for services/mapper"
[dcaegen2/services/mapper.git] / UniversalVesAdapter / src / main / java / org / onap / dcaegen2 / ves / domain / ves70 / ObjectInstance.java
1 /*\r
2 * ============LICENSE_START=======================================================\r
3 * ONAP : DCAE\r
4 * ================================================================================\r
5 * Copyright 2019 TechMahindra\r
6 *=================================================================================\r
7 * Licensed under the Apache License, Version 2.0 (the "License");\r
8 * you may not use this file except in compliance with the License.\r
9 * You may obtain a copy of the License at\r
10 *\r
11 *     http://www.apache.org/licenses/LICENSE-2.0\r
12 *\r
13 * Unless required by applicable law or agreed to in writing, software\r
14 * distributed under the License is distributed on an "AS IS" BASIS,\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16 * See the License for the specific language governing permissions and\r
17 * limitations under the License.\r
18 * ============LICENSE_END=========================================================\r
19 */\r
20 package org.onap.dcaegen2.ves.domain.ves70;\r
21 \r
22 import java.util.ArrayList;\r
23 import java.util.List;\r
24 import com.fasterxml.jackson.annotation.JsonInclude;\r
25 import com.fasterxml.jackson.annotation.JsonProperty;\r
26 import com.fasterxml.jackson.annotation.JsonPropertyDescription;\r
27 import com.fasterxml.jackson.annotation.JsonPropertyOrder;\r
28 import org.apache.commons.lang.builder.EqualsBuilder;\r
29 import org.apache.commons.lang.builder.HashCodeBuilder;\r
30 import org.apache.commons.lang.builder.ToStringBuilder;\r
31 \r
32 \r
33 /**\r
34  * meta-information about an instance of a jsonObject along with the actual object instance\r
35  * \r
36  */\r
37 @JsonInclude(JsonInclude.Include.NON_NULL)\r
38 @JsonPropertyOrder({\r
39     "jsonObject",\r
40     "objectInstance",\r
41     "objectInstanceEpochMicrosec",\r
42     "objectKeys"\r
43 })\r
44 public class ObjectInstance {\r
45 \r
46     /**\r
47      * json object schema, name and other meta-information along with one or more object instances\r
48      * \r
49      */\r
50     @JsonProperty("jsonObject")\r
51     @JsonPropertyDescription("json object schema, name and other meta-information along with one or more object instances")\r
52     private AdditionalObject jsonObject;\r
53     /**\r
54      * an instance conforming to the jsonObject objectSchema\r
55      * \r
56      */\r
57     @JsonProperty("objectInstance")\r
58     @JsonPropertyDescription("an instance conforming to the jsonObject objectSchema")\r
59     private ObjectInstance objectInstance;\r
60     /**\r
61      * the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds\r
62      * \r
63      */\r
64     @JsonProperty("objectInstanceEpochMicrosec")\r
65     @JsonPropertyDescription("the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds")\r
66     private Double objectInstanceEpochMicrosec;\r
67     /**\r
68      * an ordered set of keys that identifies this particular instance of jsonObject\r
69      * \r
70      */\r
71     @JsonProperty("objectKeys")\r
72     @JsonPropertyDescription("an ordered set of keys that identifies this particular instance of jsonObject")\r
73     private List<ObjectKey> objectKeys = new ArrayList<ObjectKey>();\r
74 \r
75     /**\r
76      * json object schema, name and other meta-information along with one or more object instances\r
77      * \r
78      */\r
79     @JsonProperty("jsonObject")\r
80     public AdditionalObject getJsonObject() {\r
81         return jsonObject;\r
82     }\r
83 \r
84     /**\r
85      * json object schema, name and other meta-information along with one or more object instances\r
86      * \r
87      */\r
88     @JsonProperty("jsonObject")\r
89     public void setJsonObject(AdditionalObject jsonObject) {\r
90         this.jsonObject = jsonObject;\r
91     }\r
92 \r
93     /**\r
94      * an instance conforming to the jsonObject objectSchema\r
95      * \r
96      */\r
97     @JsonProperty("objectInstance")\r
98     public ObjectInstance getObjectInstance() {\r
99         return objectInstance;\r
100     }\r
101 \r
102     /**\r
103      * an instance conforming to the jsonObject objectSchema\r
104      * \r
105      */\r
106     @JsonProperty("objectInstance")\r
107     public void setObjectInstance(ObjectInstance objectInstance) {\r
108         this.objectInstance = objectInstance;\r
109     }\r
110 \r
111     /**\r
112      * the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds\r
113      * \r
114      */\r
115     @JsonProperty("objectInstanceEpochMicrosec")\r
116     public Double getObjectInstanceEpochMicrosec() {\r
117         return objectInstanceEpochMicrosec;\r
118     }\r
119 \r
120     /**\r
121      * the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds\r
122      * \r
123      */\r
124     @JsonProperty("objectInstanceEpochMicrosec")\r
125     public void setObjectInstanceEpochMicrosec(Double objectInstanceEpochMicrosec) {\r
126         this.objectInstanceEpochMicrosec = objectInstanceEpochMicrosec;\r
127     }\r
128 \r
129     /**\r
130      * an ordered set of keys that identifies this particular instance of jsonObject\r
131      * \r
132      */\r
133     @JsonProperty("objectKeys")\r
134     public List<ObjectKey> getObjectKeys() {\r
135         return objectKeys;\r
136     }\r
137 \r
138     /**\r
139      * an ordered set of keys that identifies this particular instance of jsonObject\r
140      * \r
141      */\r
142     @JsonProperty("objectKeys")\r
143     public void setObjectKeys(List<ObjectKey> objectKeys) {\r
144         this.objectKeys = objectKeys;\r
145     }\r
146 \r
147     @Override\r
148     public String toString() {\r
149         return ToStringBuilder.reflectionToString(this);\r
150     }\r
151 \r
152     @Override\r
153     public int hashCode() {\r
154         return new HashCodeBuilder().append(jsonObject).append(objectInstance).append(objectInstanceEpochMicrosec).append(objectKeys).toHashCode();\r
155     }\r
156 \r
157     @Override\r
158     public boolean equals(Object other) {\r
159         if (other == this) {\r
160             return true;\r
161         }\r
162         if ((other instanceof ObjectInstance) == false) {\r
163             return false;\r
164         }\r
165         ObjectInstance rhs = ((ObjectInstance) other);\r
166         return new EqualsBuilder().append(jsonObject, rhs.jsonObject).append(objectInstance, rhs.objectInstance).append(objectInstanceEpochMicrosec, rhs.objectInstanceEpochMicrosec).append(objectKeys, rhs.objectKeys).isEquals();\r
167     }\r
168 \r
169 }\r