com.stanfy.enroscar.async.internal.AsyncContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of enroscar-content Show documentation
Show all versions of enroscar-content Show documentation
Helper classes and extended abstractions for Android loaders, content resolvers, and DB access.
package com.stanfy.enroscar.async.internal;
import android.content.Context;
import com.stanfy.enroscar.async.Async;
/**
* @param data type
*/
class AsyncContext implements AsyncProvider {
/** Application context. */
final Context applicationContext;
/** Delegate instance. */
private final Async async;
public AsyncContext(final Context context, final Async async) {
if (async == null) {
throw new IllegalArgumentException(
"Async operation instance is null. Have you implemented @Load or @Send method?"
);
}
this.applicationContext = context.getApplicationContext();
this.async = async;
}
@Override
public Async provideAsync() {
return async;
}
protected void releaseData(final D data) {
// TODO
}
}