Sha256: 33d57a09f800d1c5a2e67987f79a551942a47067ed9d5ef647a4748dfc81fe4b

Contents?: true

Size: 921 Bytes

Versions: 21

Compression:

Stored size: 921 Bytes

Contents

package com.amplify.honeydew_server;

import org.apache.commons.lang.exception.ExceptionUtils;

public class Result {
    public final boolean success;
    public String description;
    public String errorMessage;
    public String stackTrace;

    public static Result OK = new Result();
    public static Result FAILURE = new Result(false);

    public Result() {
        this(true);
    }

    public Result(boolean success) {
        this(success, success ? "Success!" : "Failure.");
    }

    public Result(boolean success, String description) {
        this.success = success;
        this.description = description;
    }

    public Result(String errorMessage, Throwable exception) {
        this(errorMessage);
        this.stackTrace = ExceptionUtils.getFullStackTrace(exception);
    }

    public Result(String errorMessage) {
        this.success = false;
        this.errorMessage = errorMessage;
    }
}

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
honeydew-0.14.0 server/src/main/java/com/amplify/honeydew_server/Result.java