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

de.adorsys.multibanking.domain.exception.MultibankingException Maven / Gradle / Ivy

There is a newer version: 5.5.43
Show newest version
package de.adorsys.multibanking.domain.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Collections;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
public class MultibankingException extends RuntimeException {

    private int httpResponseCode;
    private List messages;
    private MultibankingError multibankingError;

    public MultibankingException(MultibankingError multibankingError) {
        this(multibankingError, 400, Collections.emptyList());
    }

    public MultibankingException(MultibankingError multibankingError, int httpResponseCode, String messageString) {
        this(multibankingError, httpResponseCode, Collections.singletonList(Message.builder()
            .renderedMessage(messageString)
            .build())
        );
    }

    public MultibankingException(MultibankingError multibankingError, String messageString) {
        this(multibankingError, 400, Collections.singletonList(Message.builder()
            .renderedMessage(messageString)
            .build())
        );
    }

    public MultibankingException(MultibankingError multibankingError, List messages) {
        this(multibankingError, 400, messages);
    }

    public MultibankingException(MultibankingError multibankingError, int httpResponseCode, List messages) {
        super(messages.toString());
        this.messages = messages;
        this.multibankingError = multibankingError;
        this.httpResponseCode = httpResponseCode;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy