Last active
February 8, 2016 08:35
-
-
Save cattaka/34eb0d65fd952c095032 to your computer and use it in GitHub Desktop.
Example of enum that has methods.
This file contains hidden or 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
public enum ConnectionStatus { | |
NOT_CONNECTED(false), | |
CONNECTING(false), | |
CONNECTED(true); | |
private final boolean established; | |
public ConnectionStatus(boolean established) { | |
this.established = established; | |
} | |
public boolean isEstablished() { | |
return established; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment