2018-02-19 16:34:32 +01:00
|
|
|
package org.gcube.social_networking.socialnetworking.model.output;
|
2017-10-21 22:34:40 +02:00
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
|
/**
|
2018-02-16 18:41:59 +01:00
|
|
|
* Response bean with real result of type T.
|
2017-10-21 22:34:40 +02:00
|
|
|
* @author Costantino Perciante at ISTI-CNR
|
|
|
|
* (costantino.perciante@isti.cnr.it)
|
|
|
|
*/
|
2018-02-16 18:41:59 +01:00
|
|
|
public class ResponseBean <T> implements Serializable {
|
2017-10-21 22:34:40 +02:00
|
|
|
|
|
|
|
private static final long serialVersionUID = -2725238162673879658L;
|
|
|
|
|
|
|
|
private boolean success;
|
|
|
|
private String message;
|
2018-02-16 18:41:59 +01:00
|
|
|
private T result;
|
2017-10-21 22:34:40 +02:00
|
|
|
|
|
|
|
public ResponseBean() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param success
|
|
|
|
* @param message
|
|
|
|
* @param result
|
|
|
|
*/
|
2018-02-16 18:41:59 +01:00
|
|
|
public ResponseBean(boolean success, String message, T result) {
|
2017-10-21 22:34:40 +02:00
|
|
|
super();
|
|
|
|
this.success = success;
|
|
|
|
this.message = message;
|
|
|
|
this.result = result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isSuccess() {
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setSuccess(boolean success) {
|
|
|
|
this.success = success;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getMessage() {
|
|
|
|
return message;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setMessage(String message) {
|
|
|
|
this.message = message;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-16 18:41:59 +01:00
|
|
|
public T getResult() {
|
2017-10-21 22:34:40 +02:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-02-16 18:41:59 +01:00
|
|
|
public void setResult(T result) {
|
2017-10-21 22:34:40 +02:00
|
|
|
this.result = result;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "ResponseBean [success=" + success
|
|
|
|
+ ", message=" + message + ", result=" + result + "]";
|
|
|
|
}
|
|
|
|
}
|