Skip to content

Instantly share code, notes, and snippets.

@tscho
Created September 15, 2011 21:17
Show Gist options
  • Save tscho/1220505 to your computer and use it in GitHub Desktop.
Save tscho/1220505 to your computer and use it in GitHub Desktop.
enum FileState {
NEW {
FileState pass() { return DOWNLOADING; }
FileState fail() { return NEW; }
},
DOWNLOADING {
FileState pass() { return PROCESSING; }
FileState fail() { return DLFAILED; }
},
DLFAILED {
FileState pass() { return DLFAILED; }
FileState fail() { return DLFAILED; }
},
PROCESSING {
FileState pass() { return DONE; }
FileState fail() { return PROCESSFAILED; }
},
PROCESSFAILED {
FileState pass() { return PROCESSFAILED; }
FileState fail() { return PROCESSFAILED; }
},
DONE {
FileState pass() { return DONE; }
FileState fail() { return DONE; }
};
abstract FileState pass();
abstract FileState fail();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment