Skip to content

Instantly share code, notes, and snippets.

@khunzohn
Last active January 23, 2018 18:27
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 khunzohn/8eb5ac9f4cf1b240c2de9bdb7fce582b to your computer and use it in GitHub Desktop.
Save khunzohn/8eb5ac9f4cf1b240c2de9bdb7fce582b to your computer and use it in GitHub Desktop.
Data object that contains States information
public final class User {
public final String id;
public final String name;
public final Throwable error; // the reason for failing to fetch will be stored here
public final State state; //either of SUCCESS,PROGRESS,ERROR enum
public User(Throwable error, State state, String id, String name) {
this.error = error;
this.state = state;
this.id = id;
this.name = name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment