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

io.gumga.security.ProxyProblemResponse Maven / Gradle / Ivy

package io.gumga.security;

import io.gumga.presentation.exceptionhandler.GumgaRunTimeException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.http.HttpStatus;

public class ProxyProblemResponse {

    public String message;

    public String cause;

    public ProxyProblemResponse(String message, String cause) {
        this.message = message;
        this.cause = cause;
    }

    public String getMessage() {
        return message;
    }

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

    public String getCause() {
        return cause;
    }

    public void setCause(String cause) {
        this.cause = cause;
    }

    public Map getMap() {
        Map resposta = new HashMap();
        resposta.put("message", message);
        resposta.put("cause", cause);
        return resposta;
    }

    public List getList() {
        List resposta = new ArrayList();
        resposta.add("message:" + message);
        resposta.add("cause:" + cause);
        return resposta;
    }

    public RuntimeException exception() {
        return new GumgaRunTimeException("message:" + message + "\n" + "cause:" + cause, HttpStatus.SERVICE_UNAVAILABLE);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy