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 java.util.HashMap;
|
| 26 | import java.util.Map;
|
| 27 | import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
| 28 | import com.fasterxml.jackson.annotation.JsonAnySetter;
|
| 29 | import com.fasterxml.jackson.annotation.JsonIgnore;
|
| 30 | import com.fasterxml.jackson.annotation.JsonInclude;
|
| 31 | import com.fasterxml.jackson.annotation.JsonProperty;
|
| 32 | import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
| 33 | import org.apache.commons.lang.builder.EqualsBuilder;
|
| 34 | import org.apache.commons.lang.builder.HashCodeBuilder;
|
| 35 | import org.apache.commons.lang.builder.ToStringBuilder;
|
| 36 |
|
| 37 |
|
| 38 | @JsonInclude(JsonInclude.Include.NON_NULL)
|
| 39 | @JsonPropertyOrder({
|
| 40 | "instanceId",
|
| 41 | "modelInfo"
|
| 42 | })
|
| 43 | public class RelatedModel extends org.onap.osam.domain.mso.RelatedModel {
|
| 44 |
|
| 45 | @JsonProperty("modelInfo")
|
| 46 | private org.onap.osam.domain.mso.ModelInfo modelInfo;
|
| 47 |
|
| 48 | // /** The related model object instance list. */
|
| 49 | // @JsonProperty("instanceId")
|
| 50 | // private org.onap.vid.domain.mso.InstanceIds instanceId;
|
| 51 |
|
| 52 | /** The additional properties. */
|
| 53 | @JsonIgnore
|
| 54 | private Map<String, Object> additionalProperties = new HashMap<String, Object>();
|
| 55 |
|
| 56 | /**
|
| 57 | * (Required).
|
| 58 | *
|
| 59 | * @return The modelInfo
|
| 60 | */
|
| 61 | @JsonProperty("modelInfo")
|
| 62 | public org.onap.osam.domain.mso.ModelInfo getModelInfo() {
|
| 63 | return modelInfo;
|
| 64 | }
|
| 65 |
|
| 66 | /**
|
| 67 | * (Required).
|
| 68 | *
|
| 69 | * @param modelInfo The modelInfo
|
| 70 | */
|
| 71 | @JsonProperty("modelInfo")
|
| 72 | public void setModelInfo(org.onap.osam.domain.mso.ModelInfo modelInfo) {
|
| 73 | this.modelInfo = modelInfo;
|
| 74 | }
|
| 75 |
|
| 76 | /* (non-Javadoc)
|
| 77 | * @see org.onap.vid.domain.mso.RelatedModel#toString()
|
| 78 | */
|
| 79 | @Override
|
| 80 | public String toString() {
|
| 81 | return ToStringBuilder.reflectionToString(this);
|
| 82 | }
|
| 83 |
|
| 84 | /* (non-Javadoc)
|
| 85 | * @see org.onap.vid.domain.mso.RelatedModel#getAdditionalProperties()
|
| 86 | */
|
| 87 | @JsonAnyGetter
|
| 88 | public Map<String, Object> getAdditionalProperties() {
|
| 89 | return this.additionalProperties;
|
| 90 | }
|
| 91 |
|
| 92 | /* (non-Javadoc)
|
| 93 | * @see org.onap.vid.domain.mso.RelatedModel#setAdditionalProperty(java.lang.String, java.lang.Object)
|
| 94 | */
|
| 95 | @JsonAnySetter
|
| 96 | public void setAdditionalProperty(String name, Object value) {
|
| 97 | this.additionalProperties.put(name, value);
|
| 98 | }
|
| 99 |
|
| 100 | /* (non-Javadoc)
|
| 101 | * @see org.onap.vid.domain.mso.RelatedModel#hashCode()
|
| 102 | */
|
| 103 | @Override
|
| 104 | public int hashCode() {
|
| 105 | return new HashCodeBuilder().append(getInstanceId()).append(modelInfo).append(additionalProperties).toHashCode();
|
| 106 | }
|
| 107 |
|
| 108 | /* (non-Javadoc)
|
| 109 | * @see org.onap.vid.domain.mso.RelatedModel#equals(java.lang.Object)
|
| 110 | */
|
| 111 | @Override
|
| 112 | public boolean equals(Object other) {
|
| 113 | if (other == this) {
|
| 114 | return true;
|
| 115 | }
|
| 116 | if ((other instanceof RelatedModel) == false) {
|
| 117 | return false;
|
| 118 | }
|
| 119 | RelatedModel rhs = ((RelatedModel) other);
|
| 120 | return new EqualsBuilder().append(getInstanceId(), rhs.getInstanceId()).append(modelInfo, rhs.modelInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
|
| 121 | }
|
| 122 |
|
| 123 | }
|