Enum Class Month

java.lang.Object
java.lang.Enum<Month>
ch.poole.openinghoursparser.Month
All Implemented Interfaces:
Serializable, Comparable<Month>, Constable

public enum Month extends Enum<Month>
Container for objects from the opening_hours specification
  • Enum Constant Details

    • JAN

      public static final Month JAN
    • FEB

      public static final Month FEB
    • MAR

      public static final Month MAR
    • APR

      public static final Month APR
    • MAY

      public static final Month MAY
    • JUN

      public static final Month JUN
    • JUL

      public static final Month JUL
    • AUG

      public static final Month AUG
    • SEP

      public static final Month SEP
    • OCT

      public static final Month OCT
    • NOV

      public static final Month NOV
    • DEC

      public static final Month DEC
  • Method Details

    • values

      public static Month[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Month valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Month>
    • getValue

      public static Month getValue(String month)
      Get the Month value for a String
      Parameters:
      month - the month as a String
      Returns:
      a Month or null
    • nameValues

      public static List<String> nameValues()
      Get list of all values as Strings
      Returns:
      a List with all values
    • lastDay

      public static int lastDay(int year, Month month) throws ch.poole.openinghoursparser.ParseException
      Return the last day of the month
      Parameters:
      year - the year
      month - the month
      Returns:
      the last day
      Throws:
      ch.poole.openinghoursparser.ParseException - if no valid year is supplied and the month is February