Skip to content

Instantly share code, notes, and snippets.

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 wangchauyan/26d1e148beca2de9fdfb13b057474cf6 to your computer and use it in GitHub Desktop.
Save wangchauyan/26d1e148beca2de9fdfb13b057474cf6 to your computer and use it in GitHub Desktop.
Enum example
class EnumExample {
private enum Status {
Init, Success, Failed, Loading
}
public static enum ProcessStatus {
LOAD_STAGE(Status.Init),
END_STAGE(Status.Failed);
private final Status mStatus;
private ProcessStatus(Status id) {
mStatus = id;
}
public Status getStatus(){
return mStatus;
}
}
public static void main(String[] args) {
System.out.println(ProcessStatus.LOAD_STAGE.getStatus());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment