com.joestelmach.natty.Season Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of natty Show documentation
Show all versions of natty Show documentation
natural language date parser
The newest version!
package com.joestelmach.natty;
import java.util.HashMap;
import java.util.Map;
public enum Season {
WINTER("Winter Solstice"),
SPRING("Vernal Equinox"),
SUMMER("Summer Solstice"),
FALL("Autumnal Equinox");
private String summary;
private static final Map lookup;
static {
lookup = new HashMap();
for(Season h:values()) {
lookup.put(h.getSummary(), h);
}
}
Season(String summary) {
this.summary = summary;
}
public String getSummary() {
return summary;
}
public static Season fromSummary(String summary) {
if(summary == null) return null;
return lookup.get(summary);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy