package ch.mod_p.sre24.e5.data;

/* loaded from: classes.dex */
public class Result<T> {
    private Result() {
    }

    public String toString() {
        if (this instanceof Success) {
            return "Success[data=" + ((Success) this).getData().toString() + "]";
        }
        if (!(this instanceof Error)) {
            return "";
        }
        return "Error[exception=" + ((Error) this).getError().toString() + "]";
    }

    public static final class Success<T> extends Result {
        private T data;

        public T getData() {
            return this.data;
        }

        public Success(T t) {
            super();
            this.data = t;
        }
    }

    public static final class Error extends Result {
        private final Exception error;

        public Exception getError() {
            return this.error;
        }

        public Error(Exception exc) {
            super();
            this.error = exc;
        }
    }
}
