All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stanfy.enroscar.async.internal.AsyncContext Maven / Gradle / Ivy

Go to download

Helper classes and extended abstractions for Android loaders, content resolvers, and DB access.

There is a newer version: 2.1
Show newest version
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
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy