The constructor for this enum is private. What does that mean?
public enum SLocale {
EN_US(Locale.US, "www.abc.com", "www.edc.com", "www.vvv.com",
"www.earn.com");
List<String> domains;
Locale loc;
IMap map;
private SLocale(Locale loc, String... domains) {
this.domains = Arrays.asList(domains);
this.loc = loc;
this.siteMap = Factory.getMap(loc);
}
public List<String> getDomains() {
return domains;
}
public Locale getLoc() {
return loc;
}
public ISiteMap getMap() {
return map;
}
}
A private constructor only allows objects to be constructed from within the class definition. Being an enum, it is easy to get confused, so I usually find it easier to think of an enum as a class with some special features. So when you write:
Basically, the parameters
will be passed to the private constructor so that the enum can be instantiated. Enum constructors have to be private.