com.virjar.sekiro.api.CommonRes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sekiro-api Show documentation
Show all versions of sekiro-api Show documentation
ratel api,used for developer on ratel system,an extension for xposed framewrok,ratel api compatable with original xposed framework
package com.virjar.sekiro.api;
public class CommonRes {
private int status = statusOK;
private String message;
private T data;
private String clientId;
public static final int statusOK = 0;
public static final int statusError = -1;
public static final int statusBadRequest = -2;
public static CommonRes success(T t) {
CommonRes ret = new CommonRes<>();
ret.status = statusOK;
ret.message = null;
ret.data = t;
return ret;
}
public CommonRes(int status, String message, T data) {
this.status = status;
this.message = message;
this.data = data;
}
public CommonRes() {
}
public static CommonRes failed(String message) {
return failed(statusError, message);
}
public static CommonRes failed(int status, String message) {
CommonRes ret = new CommonRes<>();
ret.status = status;
ret.message = message;
return ret;
}
public boolean isOk() {
return status == statusOK;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
}