joinus-java

Enum – Create groups for values

If you need to create groups for your Enum class, there are few options which you can choose. Here is examples of two ways. Inner Enum class public class EnumGroups { public enum Fields{ USER_NAME(Group.USER_BASIC), USER_SURNAME(Group.USER_BASIC), USER_EMAIL(Group.USER_BASIC), USER_PHONE(Group.USER_BASIC), USER_STREET(Group.USER_ADDRESS), USER_ZIP(Group.USER_ADDRESS), USER_COUNTRY(Group.USER_ADDRESS), USER_NEWS(Group.USER_SETTINGS), USER_PRODUCT(Group.USER_SETTINGS); Fields(Group group) { this.group = group; } private final Group group; public […]

Read More