Skip to content

Instantly share code, notes, and snippets.

@vishnusosale
Last active November 19, 2016 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishnusosale/ee2c6f60bfac3271856071db6131a176 to your computer and use it in GitHub Desktop.
Save vishnusosale/ee2c6f60bfac3271856071db6131a176 to your computer and use it in GitHub Desktop.
Main entry point for accessing the Challenges data
import android.support.annotation.NonNull;
/**
* This is the main entry point for accessing the Challenges data
*/
public interface ChallengesDataStore {
// Get all challenge data
void getChallenges(@NonNull GetChallengesCallback getChallengesCallback);
// Save all challenge data
void saveChallenges(@NonNull Challenge challenge);
// Clear persisted challenge data
void deleteAllChallenges();
// Callback interface
interface GetChallengesCallback {
void onChallengesLoaded(List<Challenge> challenges);
void onError(Exception errorMessage);
void onDataNotAvailable();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment