I have a class with some system constants, some of these constants are for an example image types {jpg, png,jpeg}
In another class I am checking whether the provided extension is one of supported extensions in the systemConstants
class or not.
I want to do such check with a loop, I do not want to do do it one by one manually.
To clarify further, if the user entered any extension I would like to check if it's a valid extension or not as follows:
if (ext != sysConstants.jpg || ext != sysConstants.jpeg || ext !=
sysConstants.png) {
//do smthing
}
How can I iterate through these constants?
Update:
eclipse highlights the enum with red and says cant resolved to a type
public class EnumTest {
public enum Ext {
jpg,
jpeg,
png
}
}