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