Package com.firebase.ui.auth.data.model
Class Resource<T>
- java.lang.Object
-
- com.firebase.ui.auth.data.model.Resource<T>
-
public final class Resource<T> extends Object
Base state model object.This state can either be successful or not. In either case, it must be complete to represent these states.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static <T> Resource<T>
forFailure(Exception e)
Creates a failed resource with an exception.static <T> Resource<T>
forLoading()
Creates a resource in the loading state, without a value or an exception.static <T> Resource<T>
forSuccess(T value)
Creates a successful resource containing a value.Exception
getException()
State
getState()
T
getValue()
int
hashCode()
boolean
isUsed()
String
toString()
-
-
-
Method Detail
-
forSuccess
@NonNull public static <T> Resource<T> forSuccess(@NonNull T value)
Creates a successful resource containing a value.
-
forFailure
@NonNull public static <T> Resource<T> forFailure(@NonNull Exception e)
Creates a failed resource with an exception.
-
forLoading
@NonNull public static <T> Resource<T> forLoading()
Creates a resource in the loading state, without a value or an exception.
-
getState
@NonNull public State getState()
-
getException
@Nullable public final Exception getException()
-
getValue
@Nullable public T getValue()
-
isUsed
public boolean isUsed()
-
-