enum class Mode { IMAGE, CARD, ALBUM}
Initialize
Initialize with None
val modes = EnumSet.noneOf(Mode::class.java)
Initialize with Single
val modes = EnumSet.of(Mode.IMAGE)
Initialize with Multiple
val modes = EnumSet.of(Mode.IMAGE, Mode.ALBUM)
Add/Remove Flag
Add Flag
modes.add(Mode.IMAGE)
Remove Flag
modes.remove(Mode.IMAGE)
Check Flag
Check Flag
if (modes.contains(Mode.IMAGE)) {}