Created
March 31, 2017 15:38
-
-
Save davinctor/5340a0a5fcd5d800b2a88b484e759ba8 to your computer and use it in GitHub Desktop.
Inner enum
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
public enum UpdateMode { | |
UPDATE_SIMPLE_MODE(ConnectivityMode.WIFI, ConnectivityMode.ETHERNET), | |
UPDATE_FAST_MODE(ConnectivityMode.ETHERNET) | |
} | |
public enum ConnectivityMode { | |
WIFI, | |
ETHERNET | |
} | |
// and then somewhere in code | |
switch (mUpdateMode.mConnectivityMode) { | |
case ConnectivityMode.WIFI: | |
// update simple via wifi | |
break; | |
case ConnectivityMode.ETHERNET: | |
// update simple via ehternet | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to make it in Kotlin: