Aharoni, Pavel (pa0916) | ca3cb01 | 2018-10-22 15:29:57 +0300 | [diff] [blame] | 1 | /*-
|
| 2 | * ============LICENSE_START=======================================================
|
| 3 | * OSAM
|
| 4 | * ================================================================================
|
| 5 | * Copyright (C) 2018 AT&T
|
| 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 |
|
| 22 |
|
| 23 | package org.onap.osam.mso.rest;
|
| 24 |
|
| 25 | import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
| 26 | import com.fasterxml.jackson.annotation.JsonAnySetter;
|
| 27 | import com.fasterxml.jackson.annotation.JsonIgnore;
|
| 28 | import com.fasterxml.jackson.annotation.JsonInclude;
|
| 29 | import com.fasterxml.jackson.annotation.JsonProperty;
|
| 30 | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
| 31 | import org.apache.commons.lang3.builder.EqualsBuilder;
|
| 32 | import org.apache.commons.lang3.builder.HashCodeBuilder;
|
| 33 | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| 34 | import org.onap.osam.domain.mso.CloudConfiguration;
|
| 35 | import org.onap.osam.domain.mso.ModelInfo;
|
| 36 | import org.onap.osam.domain.mso.RequestInfo;
|
| 37 | import org.onap.osam.domain.mso.RequestParameters;
|
| 38 | import org.onap.osam.domain.mso.SubscriberInfo;
|
| 39 |
|
| 40 | import java.util.HashMap;
|
| 41 | import java.util.List;
|
| 42 | import java.util.Map;
|
| 43 |
|
| 44 |
|
| 45 | @JsonInclude(JsonInclude.Include.NON_NULL)
|
| 46 | @JsonPropertyOrder({
|
| 47 | "cloudConfiguration",
|
| 48 | "modelInfo",
|
| 49 | "relatedModelList",
|
| 50 | "requestInfo",
|
| 51 | "subscriberInfo",
|
| 52 | "requestParameters",
|
| 53 | "configurationParameters"
|
| 54 | })
|
| 55 | public class RequestDetails{
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 | @JsonProperty("cloudConfiguration")
|
| 60 | private CloudConfiguration cloudConfiguration;
|
| 61 |
|
| 62 | /** The model info. */
|
| 63 | @JsonProperty("modelInfo")
|
| 64 | private ModelInfo modelInfo;
|
| 65 |
|
| 66 | /** The related model list. */
|
| 67 | @JsonProperty("relatedInstanceList")
|
| 68 | private List<RelatedInstanceWrapper> relatedInstanceList;
|
| 69 |
|
| 70 | /** The request info. */
|
| 71 | @JsonProperty("requestInfo")
|
| 72 | private RequestInfo requestInfo;
|
| 73 |
|
| 74 | /** The subscriber info. */
|
| 75 | @JsonProperty("subscriberInfo")
|
| 76 | private SubscriberInfo subscriberInfo;
|
| 77 |
|
| 78 | /** The request parameters. */
|
| 79 | @JsonProperty("requestParameters")
|
| 80 | private RequestParameters requestParameters;
|
| 81 |
|
| 82 | @JsonProperty("configurationParameters")
|
| 83 | protected List<Map<String, String>> configurationParameters;
|
| 84 |
|
| 85 | /** The additional properties. */
|
| 86 | @JsonIgnore
|
| 87 | private Map<String, Object> additionalProperties = new HashMap<String, Object>();
|
| 88 |
|
| 89 | /**
|
| 90 | * Gets the cloud configuration.
|
| 91 | *
|
| 92 | * @return The cloudConfiguration
|
| 93 | */
|
| 94 | @JsonProperty("cloudConfiguration")
|
| 95 | public CloudConfiguration getCloudConfiguration() {
|
| 96 | return cloudConfiguration;
|
| 97 | }
|
| 98 |
|
| 99 | /**
|
| 100 | * Sets the cloud configuration.
|
| 101 | *
|
| 102 | * @param cloudConfiguration The cloudConfiguration
|
| 103 | */
|
| 104 | @JsonProperty("cloudConfiguration")
|
| 105 | public void setCloudConfiguration(CloudConfiguration cloudConfiguration) {
|
| 106 | this.cloudConfiguration = cloudConfiguration;
|
| 107 | }
|
| 108 |
|
| 109 | /**
|
| 110 | * Gets the model info.
|
| 111 | *
|
| 112 | * @return The modelInfo
|
| 113 | */
|
| 114 | @JsonProperty("modelInfo")
|
| 115 | public ModelInfo getModelInfo() {
|
| 116 | return modelInfo;
|
| 117 | }
|
| 118 |
|
| 119 | /**
|
| 120 | * Sets the model info.
|
| 121 | *
|
| 122 | * @param modelInfo The modelInfo
|
| 123 | */
|
| 124 | @JsonProperty("modelInfo")
|
| 125 | public void setModelInfo(ModelInfo modelInfo) {
|
| 126 | this.modelInfo = modelInfo;
|
| 127 | }
|
| 128 | /**
|
| 129 | * Gets the related instance list.
|
| 130 | *
|
| 131 | * @return The relatedInstanceList
|
| 132 | */
|
| 133 | @JsonProperty("relatedInstanceList")
|
| 134 | public List<RelatedInstanceWrapper> getRelatedInstanceList() {
|
| 135 | return relatedInstanceList;
|
| 136 | }
|
| 137 |
|
| 138 | /**
|
| 139 | * Sets the related model list.
|
| 140 | *
|
| 141 | * @param relatedInstanceList The relatedInstanceList
|
| 142 | */
|
| 143 | @JsonProperty("relatedInstanceList")
|
| 144 | public void setRelatedInstanceList(List<RelatedInstanceWrapper> relatedInstanceList) {
|
| 145 | this.relatedInstanceList = relatedInstanceList;
|
| 146 | }
|
| 147 |
|
| 148 | /**
|
| 149 | * Gets the request info.
|
| 150 | *
|
| 151 | * @return The requestInfo
|
| 152 | */
|
| 153 | @JsonProperty("requestInfo")
|
| 154 | public RequestInfo getRequestInfo() {
|
| 155 | return requestInfo;
|
| 156 | }
|
| 157 |
|
| 158 | /**
|
| 159 | * Sets the request info.
|
| 160 | *
|
| 161 | * @param requestInfo The requestInfo
|
| 162 | */
|
| 163 | @JsonProperty("requestInfo")
|
| 164 | public void setRequestInfo(RequestInfo requestInfo) {
|
| 165 | this.requestInfo = requestInfo;
|
| 166 | }
|
| 167 |
|
| 168 | /**
|
| 169 | * Gets the subscriber info.
|
| 170 | *
|
| 171 | * @return The subscriberInfo
|
| 172 | */
|
| 173 | @JsonProperty("subscriberInfo")
|
| 174 | public SubscriberInfo getSubscriberInfo() {
|
| 175 | return subscriberInfo;
|
| 176 | }
|
| 177 |
|
| 178 | /**
|
| 179 | * Sets the subscriber info.
|
| 180 | *
|
| 181 | * @param subscriberInfo The subscriberInfo
|
| 182 | */
|
| 183 | @JsonProperty("subscriberInfo")
|
| 184 | public void setSubscriberInfo(SubscriberInfo subscriberInfo) {
|
| 185 | this.subscriberInfo = subscriberInfo;
|
| 186 | }
|
| 187 |
|
| 188 | /* (non-Javadoc)
|
| 189 | * @see org.onap.vid.domain.mso.RequestDetails#toString()
|
| 190 | */
|
| 191 | @Override
|
| 192 | public String toString() {
|
| 193 | return ToStringBuilder.reflectionToString(this);
|
| 194 | }
|
| 195 |
|
| 196 | /* (non-Javadoc)
|
| 197 | * @see org.onap.vid.domain.mso.RequestDetails#getAdditionalProperties()
|
| 198 | */
|
| 199 | @JsonAnyGetter
|
| 200 | public Map<String, Object> getAdditionalProperties() {
|
| 201 | return this.additionalProperties;
|
| 202 | }
|
| 203 |
|
| 204 | /* (non-Javadoc)
|
| 205 | * @see org.onap.vid.domain.mso.RequestDetails#setAdditionalProperty(java.lang.String, java.lang.Object)
|
| 206 | */
|
| 207 | @JsonAnySetter
|
| 208 | public void setAdditionalProperty(String name, Object value) {
|
| 209 | this.additionalProperties.put(name, value);
|
| 210 | }
|
| 211 |
|
| 212 | @JsonProperty("configurationParameters")
|
| 213 | public List<Map<String, String>> getConfigurationParameters() {
|
| 214 | return configurationParameters;
|
| 215 | }
|
| 216 |
|
| 217 | @JsonProperty("configurationParameters")
|
| 218 | public void setConfigurationParameters(List<Map<String, String>> configurationParameters) {
|
| 219 | this.configurationParameters = configurationParameters;
|
| 220 | }
|
| 221 |
|
| 222 | /* (non-Javadoc)
|
| 223 | * @see org.onap.vid.domain.mso.RequestDetails#hashCode()
|
| 224 | */
|
| 225 | @Override
|
| 226 | public int hashCode() {
|
| 227 | return new HashCodeBuilder()
|
| 228 | .append(cloudConfiguration)
|
| 229 | .append(modelInfo)
|
| 230 | .append(relatedInstanceList)
|
| 231 | .append(requestInfo)
|
| 232 | .append(getRequestParameters())
|
| 233 | .append(subscriberInfo)
|
| 234 | .append(additionalProperties)
|
| 235 | .append(configurationParameters)
|
| 236 | .toHashCode();
|
| 237 | }
|
| 238 |
|
| 239 | /* (non-Javadoc)
|
| 240 | * @see org.onap.vid.domain.mso.RequestDetails#equals(java.lang.Object)
|
| 241 | */
|
| 242 | @Override
|
| 243 | public boolean equals(Object other) {
|
| 244 | if (other == this) {
|
| 245 | return true;
|
| 246 | }
|
| 247 | if (!(other instanceof RequestDetails)) {
|
| 248 | return false;
|
| 249 | }
|
| 250 | RequestDetails rhs = ((RequestDetails) other);
|
| 251 | return new EqualsBuilder()
|
| 252 | .append(cloudConfiguration, rhs.cloudConfiguration)
|
| 253 | .append(modelInfo, rhs.modelInfo)
|
| 254 | .append(relatedInstanceList, rhs.relatedInstanceList)
|
| 255 | .append(requestInfo, rhs.requestInfo)
|
| 256 | .append(getRequestParameters(), rhs.getRequestParameters())
|
| 257 | .append(subscriberInfo, rhs.subscriberInfo)
|
| 258 | .append(additionalProperties, rhs.additionalProperties)
|
| 259 | .append(configurationParameters, rhs.configurationParameters)
|
| 260 | .isEquals();
|
| 261 | }
|
| 262 |
|
| 263 | public RequestParameters getRequestParameters() {
|
| 264 | return requestParameters;
|
| 265 | }
|
| 266 |
|
| 267 | public void setRequestParameters(RequestParameters requestParameters) {
|
| 268 | this.requestParameters = requestParameters;
|
| 269 | }
|
| 270 | }
|