I need to create the Enum class for authentication. Each enum need to store a Map<String,Set>.So, I know how to create a Enum, but set values into map and set seems weird. Maybe you have idea, how do it better? Code I have:
public enum Auth{
NO_AUTH(new HashMap<>()),
Auth(new HashMap<>());
private Map<String,Set<String>> fields;
private Auth(Map<String,Set<String>> fields){
this.fields = fields;
}
}
I want to fill my map, like that:
NO_AUTH(new HashMap<String>().put(1,new HashSet<String>().add("2"));