All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.virjar.sekiro.api.CommonRes Maven / Gradle / Ivy

Go to download

ratel api,used for developer on ratel system,an extension for xposed framewrok,ratel api compatable with original xposed framework

There is a newer version: 1.0.5
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy