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

com.stanfy.enroscar.content.CursorAsyncBuilder 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.content;

import android.content.Context;
import android.database.Cursor;

import com.stanfy.enroscar.async.Async;
import com.stanfy.enroscar.async.internal.CursorAsync;

import static com.stanfy.enroscar.content.ContentProviderQuery.BaseParamsBuilder;
import static com.stanfy.enroscar.content.ContentProviderQuery.Builder.makeQuery;

/**
 * Builder for {@link com.stanfy.enroscar.async.Async} that loads a {@link Cursor}
 * @author Roman Mazur - Stanfy (http://stanfy.com)
 */
public final class CursorAsyncBuilder extends BaseParamsBuilder, CursorAsyncBuilder> {

  /** Observation flag. */
  private boolean observeDescendants;

  public CursorAsyncBuilder(final Context context) {
    super(context);
  }

  public CursorAsyncBuilder observeDescendants(final boolean value) {
    this.observeDescendants = value;
    return this;
  }

  @Override
  public Async get() {
    return new CursorAsync(makeQuery(context, params), observeDescendants);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy