Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / mso / rest / RequestList.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 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.mso.rest;
22
23 import com.fasterxml.jackson.annotation.*;
24 import org.apache.commons.lang.builder.EqualsBuilder;
25 import org.apache.commons.lang.builder.HashCodeBuilder;
26 import org.apache.commons.lang.builder.ToStringBuilder;
27
28 import java.util.HashMap;
29 import java.util.List;
30 import java.util.Map;
31
32 /**
33  * List of relatedModel structures that are related to a modelInfo being operated on.
34  */
35 @JsonInclude(JsonInclude.Include.NON_NULL)
36 @JsonPropertyOrder({
37     "finishTime",
38     "instanceIds",
39     "requestDetails",
40     "requestId",
41     "requestScope",
42     "requestStatus",
43     "requestType",
44     "startTime"
45 })
46
47 public class RequestList {
48     
49     /** The request list. */
50     private List<RequestWrapper> requestList;
51     
52     /** The additional properties. */
53     @JsonIgnore
54     private Map<String, Object> additionalProperties = new HashMap<>();
55
56     /**
57      * (Required).
58      *
59      * @return     The RelatedModel List
60      */
61     public List<RequestWrapper> getRequestList() {
62         return requestList;
63     }
64
65     /**
66      * Sets the request list.
67      *
68      * @param l the new request list
69      */
70     public void setRequestList(List<RequestWrapper> l) {
71         this.requestList = l;
72     }
73
74     /* (non-Javadoc)
75      * @see java.lang.Object#toString()
76      */
77     @Override
78     public String toString() {
79         return ToStringBuilder.reflectionToString(this);
80     }
81
82     /**
83      * Gets the additional properties.
84      *
85      * @return the additional properties
86      */
87     @JsonAnyGetter
88     public Map<String, Object> getAdditionalProperties() {
89         return this.additionalProperties;
90     }
91
92     /**
93      * Sets the additional property.
94      *
95      * @param name the name
96      * @param value the value
97      */
98     @JsonAnySetter
99     public void setAdditionalProperty(String name, Object value) {
100         this.additionalProperties.put(name, value);
101     }
102
103     /* (non-Javadoc)
104      * @see java.lang.Object#hashCode()
105      */
106     @Override
107     public int hashCode() {
108         return new HashCodeBuilder().append(getRequestList()).append(additionalProperties).toHashCode();
109     }
110
111     /* (non-Javadoc)
112      * @see java.lang.Object#equals(java.lang.Object)
113      */
114     @Override
115     public boolean equals(Object other) {
116         if (other == this) {
117             return true;
118         }
119         if (!(other instanceof RequestList)) {
120             return false;
121         }
122         RequestList rhs = ((RequestList) other);
123         return new EqualsBuilder().append(getRequestList(), rhs.getRequestList()).append(additionalProperties, rhs.additionalProperties).isEquals();
124     }
125
126 }