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

me.sniggle.matemonkey4j.robospice.BaseMateMonkeyRequest Maven / Gradle / Ivy

The newest version!
package me.sniggle.matemonkey4j.robospice;

import com.octo.android.robospice.request.SpiceRequest;

import java.util.concurrent.Callable;

/**
 * @author tuxbox, sniggle.me
 *
 * Generic MateMonkeyRequest implementation used for all specific API request
 */
public abstract class BaseMateMonkeyRequest extends SpiceRequest {

  private final Callable delegate;

  /**
   *
   * @param clazz
   *    the response type
   * @param callable
   *    the delegate to perform the API call
   */
  protected BaseMateMonkeyRequest(Class clazz, Callable callable) {
    super(clazz);
    this.delegate = callable;
  }

  @Override
  public Response loadDataFromNetwork() throws Exception {
    return delegate.call();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy