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

com.chutneytesting.task.domain.ResultOrError Maven / Gradle / Ivy

package com.chutneytesting.task.domain;

public class ResultOrError {
    private final RESULT result;
    private final ERROR error;

    private ResultOrError(RESULT result, ERROR error) {
        this.result = result;
        this.error = error;
    }

    public boolean isError() {
        return error != null;
    }

    public boolean isOk() {
        return !isError();
    }

    public RESULT result() {
        return result;
    }

    public ERROR error() {
        return error;
    }

    public static  ResultOrError result(RESULT result) {
        return new ResultOrError(result, null);
    }

    public static  ResultOrError error(ERROR error) {
        return new ResultOrError(null, error);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy