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 java.lang.ObjectBase 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 booleanequals(java.lang.Object o)static <T> Resource<T>forFailure(java.lang.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.java.lang.ExceptiongetException()StategetState()TgetValue()inthashCode()booleanisUsed()java.lang.StringtoString()
-
-
-
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 java.lang.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 java.lang.Exception getException()
-
getValue
@Nullable public T getValue()
-
isUsed
public boolean isUsed()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-