I have a simple Enum created
public interface Params
{
public enum Locale
{
UK("UK"), US("US");
private String value;
private Locale(String value) {
this.value = value;
}
};
....
Here is my method I want to modify to take a Params.Locale attribute.
public void doErrorQuery(Locale locale, String p_listStr)
{
if (p_spellingList == null)
{
result.setError(true);
result.setErrorMessage("Null spelling list");
return;
}
I import my Locale enum using
import com.Params.Locale;
Problem is I can’t get this to compile, It’s telling me it can’t resolve the Locale. Even if I use Params.Locale it does not work, can’t resolve name.
You should use an own enum class for the enum. Doing this would be a cleaner design in my eyes: