Last active
October 28, 2020 19:54
-
-
Save nsivabalan/22e26a91b1a360543aeee16218cdce75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Interface representing Request's final status. This is a common interface for all network | |
* transports and each transport is expected to have its own implementation. | |
* | |
* @param <T> represents the actual Status object of generic type T. | |
*/ | |
public interface UberRequestStatus<T> { | |
/** | |
* Refers to the Http status code. | |
* | |
* @return the http status code. | |
*/ | |
int getResponseCode(); | |
/** @return {@code true} if the request succeeded, else {@code false}. */ | |
boolean isSuccess(); | |
/** @return the {@link Throwable} instance if request had failed. */ | |
@Nullable | |
Throwable getThrowable(); | |
/** @return the network transport's specific status object if any. */ | |
@Nullable | |
T getNetworkTransportStatus(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment