2 * ================================================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property
\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
11 * http://www.apache.org/licenses/LICENSE-2.0
\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 * ================================================================================
\r
20 package org.openecomp.portalapp.portal.ecomp.model;
\r
22 public class PortalRestResponse<T> {
\r
24 private PortalRestStatusEnum status;
\r
25 private String message;
\r
29 public PortalRestResponse(){};
\r
31 public PortalRestResponse(PortalRestStatusEnum status, String message, T response){
\r
32 this.status = status;
\r
33 this.message = message;
\r
34 this.response = response;
\r
37 public PortalRestStatusEnum getStatus() {
\r
41 public void setStatus(PortalRestStatusEnum status) {
\r
42 this.status = status;
\r
45 public String getMessage() {
\r
49 public void setMessage(String message) {
\r
50 this.message = message;
\r
53 public T getResponse() {
\r
57 public void setResponse(T response) {
\r
58 this.response = response;
\r
62 public String toString() {
\r
63 return "PortalRestResponse [status=" + status + ", message=" + message + ", response=" + response + "]";
\r
67 public int hashCode() {
\r
68 final int prime = 31;
\r
70 result = prime * result + ((message == null) ? 0 : message.hashCode());
\r
71 result = prime * result + ((response == null) ? 0 : response.hashCode());
\r
72 result = prime * result + ((status == null) ? 0 : status.hashCode());
\r
77 public boolean equals(Object obj) {
\r
82 if (getClass() != obj.getClass())
\r
84 PortalRestResponse other = (PortalRestResponse) obj;
\r
85 if (message == null) {
\r
86 if (other.message != null)
\r
88 } else if (!message.equals(other.message))
\r
90 if (response == null) {
\r
91 if (other.response != null)
\r
93 } else if (!response.equals(other.response))
\r
95 if (status != other.status)
\r