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

colesico.framework.rpc.RpcError Maven / Gradle / Ivy

The newest version!
package colesico.framework.rpc;

public class RpcError {

    private String exceptionType;
    private String message;

    public RpcError() {
    }

    public RpcError(String exceptionType, String message) {
        this.exceptionType = exceptionType;
        this.message = message;
    }

    public static RpcError of(String message) {
        return new RpcError(RpcException.class.getCanonicalName(), message);
    }

    public static RpcError of(Class exceptionType) {
        return new RpcError(exceptionType.getCanonicalName(), null);
    }

    public static RpcError of(String exceptionType, String message) {
        return new RpcError(exceptionType, message);
    }

    public static RpcError of(Class exceptionType, String message) {
        return new RpcError(exceptionType.getCanonicalName(), message);
    }

    public String getExceptionType() {
        return exceptionType;
    }

    public void setExceptionType(String exceptionType) {
        this.exceptionType = exceptionType;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "RpcError{" +
                "exceptionType='" + exceptionType + '\'' +
                ", message='" + message + '\'' +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy