All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.joestelmach.natty.Season Maven / Gradle / Ivy

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