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

io.katharsis.errorhandling.ErrorResponseBuilder Maven / Gradle / Ivy

There is a newer version: 2.6.3
Show newest version
package io.katharsis.errorhandling;

import java.util.ArrayList;
import java.util.List;

public class ErrorResponseBuilder {
    private Iterable data;
    private int status;

    public ErrorResponseBuilder setErrorData(Iterable errorObjects) {
        this.data = errorObjects;
        return this;
    }
    public ErrorResponseBuilder setSingleErrorData(ErrorData errorData) {
        List errorDatas = new ArrayList();
        errorDatas.add(errorData);
        this.data = errorDatas;
        return this;
    }

    public ErrorResponseBuilder setStatus(int status) {
        this.status = status;
        return this;
    }

    public ErrorResponse build() {
        return new ErrorResponse(data, status);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy