Skip to content

Instantly share code, notes, and snippets.

@cattaka
Last active February 8, 2016 08:35
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 cattaka/34eb0d65fd952c095032 to your computer and use it in GitHub Desktop.
Save cattaka/34eb0d65fd952c095032 to your computer and use it in GitHub Desktop.
Example of enum that has methods.
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