2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
8 * Unless otherwise specified, all software contained herein is licensed
9 * under the Apache License, Version 2.0 (the “License”);
10 * you may not use this software except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * Unless otherwise specified, all documentation contained herein is licensed
22 * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
23 * you may not use this documentation except in compliance with the License.
24 * You may obtain a copy of the License at
26 * https://creativecommons.org/licenses/by/4.0/
28 * Unless required by applicable law or agreed to in writing, documentation
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
34 * ============LICENSE_END============================================
36 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
38 package org.openecomp.portalapp.portal.ecomp.model;
40 public class PortalRestResponse<T> {
42 private PortalRestStatusEnum status;
43 private String message;
47 public PortalRestResponse(){};
49 public PortalRestResponse(PortalRestStatusEnum status, String message, T response){
51 this.message = message;
52 this.response = response;
55 public PortalRestStatusEnum getStatus() {
59 public void setStatus(PortalRestStatusEnum status) {
63 public String getMessage() {
67 public void setMessage(String message) {
68 this.message = message;
71 public T getResponse() {
75 public void setResponse(T response) {
76 this.response = response;
80 public String toString() {
81 return "PortalRestResponse [status=" + status + ", message=" + message + ", response=" + response + "]";
85 public int hashCode() {
88 result = prime * result + ((message == null) ? 0 : message.hashCode());
89 result = prime * result + ((response == null) ? 0 : response.hashCode());
90 result = prime * result + ((status == null) ? 0 : status.hashCode());
95 public boolean equals(Object obj) {
100 if (getClass() != obj.getClass())
102 PortalRestResponse other = (PortalRestResponse) obj;
103 if (message == null) {
104 if (other.message != null)
106 } else if (!message.equals(other.message))
108 if (response == null) {
109 if (other.response != null)
111 } else if (!response.equals(other.response))
113 if (status != other.status)