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

org.knowm.xchange.okcoin.FuturesContract Maven / Gradle / Ivy

There is a newer version: 5.2.1
Show newest version
package org.knowm.xchange.okcoin;

/** Delivery dates for future date currencies */
public enum FuturesContract {
  ThisWeek("this_week"),
  NextWeek("next_week"),
  Month("month"),
  Quarter("quarter");

  private final String name;

  /** Private constructor so it cannot be instantiated */
  FuturesContract(String name) {
    this.name = name;
  }

  public static > T valueOfIgnoreCase(Class enumeration, String name) {

    for (T enumValue : enumeration.getEnumConstants()) {
      if (enumValue.name().equalsIgnoreCase(name)) {
        return enumValue;
      }
    }

    throw new IllegalArgumentException(
        String.format("There is no value with name '%s' in Enum %s", name, enumeration.getName()));
  }

  public String getName() {
    return name;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy