Class AsyncTaskResult<R,​E>

  • Type Parameters:
    R - type of the expected Result.
    E - type of the expected Error.

    public class AsyncTaskResult<R,​E>
    extends java.lang.Object
    Helper class to return results to the UI thread when using an AsyncTask.
    • Method Detail

      • create

        public static <RT,​ET> AsyncTaskResult<RT,​ET> create​(@Nullable
                                                                        RT result,
                                                                        @Nullable
                                                                        ET error)
        Instantiates an AsyncTaskResult.
        Type Parameters:
        RT - type of the Result.
        ET - type of the error.
        Parameters:
        result - The result value.
        error - The error value.
        Returns:
        a new instance of an AsyncTaskResult.
      • getResult

        @Nullable
        public R getResult()
        Returns:
        the result value.
      • getError

        @Nullable
        public E getError()
        Returns:
        the error value.