Created
May 6, 2021 21:29
-
-
Save wangchauyan/26d1e148beca2de9fdfb13b057474cf6 to your computer and use it in GitHub Desktop.
Enum example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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