blob: 8426312fad8cc1f31b1d661dae82954a1289dbc7 [file] [log] [blame]
/**
* Copyright (c) 2018 CEA.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* CEA - initial API and implementation and/or initial documentation
*/
package org.eclipse.sensinact.studio.http.client.snamessage.setresponse;
import org.eclipse.sensinact.studio.http.client.snamessage.MsgSensinact;
import org.eclipse.sensinact.studio.http.client.snamessage.ObjectNameTypeValue;
/**
* @author Etienne Gandrille
*/
public class MsgSetResponse extends MsgSensinact {
public static final String KEY = "SET_RESPONSE";
private ObjectNameTypeValue response;
private String uri;
private int statusCode;
public MsgSetResponse() {
super(KEY);
}
public ObjectNameTypeValue getResponse() {
return response;
}
public void setResponse(ObjectNameTypeValue response) {
this.response = response;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public int getStatusCode() {
return statusCode;
}
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((response == null) ? 0 : response.hashCode());
result = prime * result + statusCode;
result = prime * result + ((uri == null) ? 0 : uri.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MsgSetResponse other = (MsgSetResponse) obj;
if (response == null) {
if (other.response != null)
return false;
} else if (!response.equals(other.response))
return false;
if (statusCode != other.statusCode)
return false;
if (uri == null) {
if (other.uri != null)
return false;
} else if (!uri.equals(other.uri))
return false;
return true;
}
@Override
public String toString() {
return "MsgSetResponse [response=" + response + ", uri=" + uri + ", statusCode=" + statusCode + "]";
}
}