Interface Callback<T>
A callback represents a computation which is awaiting some data to resolve to a result or be rejected with some error.
public interface Callback<T>
Methods
reject
void reject(@NonNull Throwable exception)
Called in case an error which can noy be handled occurs. If this method is called, resolve(Object)
will not be called anymore.
Parameters
Name | Description |
---|---|
exception | The error which occurred. |
resolve
void resolve(T response)
Called after the operation was successful.
Parameters
Name | Description |
---|---|
response | The data the operation produced. |