package com.github.ajalt.reprint.reactive;

import android.support.annotation.Nullable;

import com.github.ajalt.reprint.core.AuthenticationFailureReason;
import com.github.ajalt.reprint.core.ReprintModule;

/** A data class exception that holds the results of an authentication request failure. */
public class AuthenticationResult {
    public enum Status {SUCCESS, RECOVERABLE_FAILURE, UNRECOVERABLE_FAILURE}

    /**
     * The result of the authenticate call.
     * <p>
     * If the status is RECOVERABLE_FAILURE, the fingerprint sensor is still running, and more
     * events will be emitted. Other statuses are terminal events, and the fingerprint sensor will
     * be stopped by the time they are emitted.
     */
    public final Status status;
    /**
     * The general reason for the failure.
     * <p>
     * Will be null if the authentication succeeded, and non-null otherwise.
     */
    @Nullable
    public final AuthenticationFailureReason failureReason;
    /**
     * An informative string given by the underlying fingerprint sdk that can be displayed in the
     * ui.
     * <p>
     * This string is never null, and will be localized to the current locale.
     */
    public final CharSequence errorMessage;
    /**
     * The {@link ReprintModule#tag()} of the module that is currently active. This is useful to
     * know the meaning of the error code.
     */
    public final int fromModule;
    /**
     * The specific error code returned by the module's underlying sdk. Check the constants defined
     * in the module for possible values and their meanings.
     */
    public final int errorCode;

    public AuthenticationResult(Status status, @Nullable AuthenticationFailureReason failureReason,
                                CharSequence errorMessage, int fromModule, int errorCode) {
        this.status = status;
        this.failureReason = failureReason;
        this.errorMessage = errorMessage;
        this.fromModule = fromModule;
        this.errorCode = errorCode;
    }

    /** Return true if the authentication was a success. */
    public boolean isSuccessful() {
        return failureReason != null;
    }
}

@@ -33,24 +33,67 @@
 .reactive;%0A%0A
+import android.support.annotation.NonNull;%0A
 import andro
@@ -754,32 +754,45 @@
 mitted.%0A     */%0A
+    @NonNull%0A
     public final
@@ -1235,32 +1235,45 @@
 locale.%0A     */%0A
+    @NonNull%0A
     public final
@@ -1731,16 +1731,25 @@
 nResult(
+@NonNull 
 Status s
@@ -1840,16 +1840,25 @@
         
+@NonNull 
 CharSequ
@@ -2108,148 +2108,7 @@
    %7D
-%0A%0A    /** Return true if the authentication was a success. */%0A    public boolean isSuccessful() %7B%0A        return failureReason != null;%0A    %7D
 %0A%7D%0A

Add nullability annotations.