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

com.squarespace.cldrengine.api.TimePeriodField Maven / Gradle / Ivy

The newest version!
package com.squarespace.cldrengine.api;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public enum TimePeriodField {

  YEAR("year"),
  MONTH("month"),
  WEEK("week"),
  DAY("day"),
  HOUR("hour"),
  MINUTE("minute"),
  SECOND("second"),
  MILLIS("millis")
  ;

  private static final Map REVERSE = new HashMap<>();

  static {
    Arrays.stream(TimePeriodField.values()).forEach(t -> REVERSE.put(t.value, t));
  }

  private String value;

  private TimePeriodField(String v) {
    this.value = v;
  }

  public static TimePeriodField fromString(String s) {
    return REVERSE.get(s);
  }

  @Override
  public String toString() {
    return value;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy