Object NetworkResult.Companion
-
- All Implemented Interfaces:
public class NetworkResult.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static NetworkResult.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final <T extends Any> NetworkResult<T>success(T value)Returns an instance that encapsulates the given value as successful value. final <T extends Any> NetworkResult<T>failure(Throwable exception)Returns an instance that encapsulates the given Throwable as failure. final <T extends Any> Result<T>toResult(NetworkResult<T> $self)Converts this NetworkResult to a Result instance. -
-
Method Detail
-
success
final <T extends Any> NetworkResult<T> success(T value)
Returns an instance that encapsulates the given value as successful value.
-
failure
final <T extends Any> NetworkResult<T> failure(Throwable exception)
Returns an instance that encapsulates the given Throwable as failure.
-
toResult
final <T extends Any> Result<T> toResult(NetworkResult<T> $self)
Converts this NetworkResult to a Result instance.
-
-
-
-