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

net.codecrete.qrbill.generator.QRBillValidationError Maven / Gradle / Ivy

There is a newer version: 3.3.1
Show newest version
//
// Swiss QR Bill Generator
// Copyright (c) 2017 Manuel Bleichenbacher
// Licensed under MIT License
// https://opensource.org/licenses/MIT
//
package net.codecrete.qrbill.generator;

/**
 * Exception thrown if the bill data is not valid.
 */
public class QRBillValidationError extends RuntimeException {

    private static final long serialVersionUID = -959460901342010774L;

    private final ValidationResult validationResult;

    /**
     * Constructs a new instance with the specified validation result.
     *
     * @param validationResult validation result
     */
    public QRBillValidationError(ValidationResult validationResult) {
        super("QR bill data is invalid");
        this.validationResult = validationResult;
    }

    @Override
    public String getMessage() {
        return "QR bill data is invalid: " + validationResult.getDescription();
    }

    /**
     * Gets the validation result with the error messages.
     *
     * @return the validation result
     */
    public ValidationResult getValidationResult() {
        return validationResult;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy