Here\'s my problem - I\'m looking for (if it even exists) the enum equivalent of ArrayList.contains();.
Here\'s a sample of my code problem:
<
If you are using Java 1.8, you can choose Stream + Lambda to implement this:
public enum Period {
DAILY, WEEKLY
};
//This is recommended
Arrays.stream(Period.values()).anyMatch((t) -> t.name().equals("DAILY1"));
//May throw java.lang.IllegalArgumentException
Arrays.stream(Period.values()).anyMatch(Period.valueOf("DAILY")::equals);