Class RealApolloPrefetch
- java.lang.Object
-
- com.apollographql.apollo.internal.RealApolloPrefetch
-
- All Implemented Interfaces:
ApolloPrefetch,Cancelable
public final class RealApolloPrefetch extends java.lang.Object implements ApolloPrefetch
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apollographql.apollo.ApolloPrefetch
ApolloPrefetch.Callback, ApolloPrefetch.Factory
-
-
Constructor Summary
Constructors Constructor Description RealApolloPrefetch(com.apollographql.apollo.api.Operation operation, okhttp3.HttpUrl serverUrl, okhttp3.Call.Factory httpCallFactory, com.apollographql.apollo.api.ScalarTypeAdapters scalarTypeAdapters, java.util.concurrent.Executor dispatcher, com.apollographql.apollo.api.internal.ApolloLogger logger, ApolloCallTracker callTracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancels thisApolloPrefetch.ApolloPrefetchclone()Creates a new, identical ApolloPrefetch to this one which can be enqueued or executed even if this one has already been executed.voidenqueue(ApolloPrefetch.Callback responseCallback)Schedules the request to be executed at some point in the future.booleanisCanceled()Checks if this operation has been canceled.com.apollographql.apollo.api.Operationoperation()Returns GraphQL operation this call executes
-
-
-
Constructor Detail
-
RealApolloPrefetch
public RealApolloPrefetch(com.apollographql.apollo.api.Operation operation, okhttp3.HttpUrl serverUrl, okhttp3.Call.Factory httpCallFactory, com.apollographql.apollo.api.ScalarTypeAdapters scalarTypeAdapters, java.util.concurrent.Executor dispatcher, com.apollographql.apollo.api.internal.ApolloLogger logger, ApolloCallTracker callTracker)
-
-
Method Detail
-
enqueue
public void enqueue(@Nullable ApolloPrefetch.Callback responseCallback)Description copied from interface:ApolloPrefetchSchedules the request to be executed at some point in the future.- Specified by:
enqueuein interfaceApolloPrefetch- Parameters:
responseCallback- Callback which will handle the success response or a failure exception
-
operation
@NotNull public com.apollographql.apollo.api.Operation operation()
Description copied from interface:ApolloPrefetchReturns GraphQL operation this call executes- Specified by:
operationin interfaceApolloPrefetch- Returns:
Operation
-
clone
public ApolloPrefetch clone()
Description copied from interface:ApolloPrefetchCreates a new, identical ApolloPrefetch to this one which can be enqueued or executed even if this one has already been executed.- Specified by:
clonein interfaceApolloPrefetch- Overrides:
clonein classjava.lang.Object- Returns:
- The cloned ApolloPrefetch object
-
cancel
public void cancel()
Description copied from interface:ApolloPrefetchCancels thisApolloPrefetch. If the call has already completed, nothing will happen. If the call is outgoing, anApolloCanceledExceptionwill be thrown if the call was started with#execute(). If the call was started withApolloPrefetch.enqueue(Callback)theApolloPrefetch.Callbackwill be disposed, and will receive no more events. The call will attempt to abort and release resources, if possible.- Specified by:
cancelin interfaceApolloPrefetch- Specified by:
cancelin interfaceCancelable
-
isCanceled
public boolean isCanceled()
Description copied from interface:CancelableChecks if this operation has been canceled.- Specified by:
isCanceledin interfaceCancelable- Returns:
- true if this operation has been canceled else returns false
-
-