package com.amplifyframework.auth.result;

import com.amplifyframework.auth.AuthException;
import s3.d;

/* loaded from: classes4.dex */
public final class AuthSessionResult<T> {
    private final AuthException error;
    private final Type type;
    private final T value;

    /* loaded from: classes4.dex */
    public enum Type {
        SUCCESS,
        FAILURE
    }

    private AuthSessionResult(T t10, AuthException authException, Type type) {
        this.value = t10;
        this.error = authException;
        this.type = type;
    }

    public static <T> AuthSessionResult<T> failure(AuthException authException) {
        return new AuthSessionResult<>(null, authException, Type.FAILURE);
    }

    public static <T> AuthSessionResult<T> success(T t10) {
        return new AuthSessionResult<>(t10, null, Type.SUCCESS);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || !(obj instanceof AuthSessionResult)) {
            return false;
        }
        AuthSessionResult authSessionResult = (AuthSessionResult) obj;
        return d.a(getValue(), authSessionResult.getValue()) && d.a(getError(), authSessionResult.getError()) && d.a(getType(), authSessionResult.getType());
    }

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

    public Type getType() {
        return this.type;
    }

    public T getValue() {
        return this.value;
    }

    public int hashCode() {
        return d.b(getValue(), getError(), getType());
    }

    public String toString() {
        return "AuthSessionResult{value=" + getValue() + ", error=" + getError() + ", type=" + getType() + '}';
    }
}
