java.lang.Object
java.lang.Enum<TIME>
cz.krystofcejchan.lite_weather_lib.enums_exception.enums.TIME
All Implemented Interfaces:
Serializable, Comparable<TIME>, Constable

public enum TIME
extends Enum<TIME>
TIMES for weather forecast
AM_3, AM_6, AM_9, AM_12, PM_3, PM_6, PM_9, PM_12, ALL;
  • Enum Constant Details

    • AM_3

      public static final TIME AM_3
      3:00 a.m.
    • AM_6

      public static final TIME AM_6
      6:00 a.m.
    • AM_9

      public static final TIME AM_9
      9:00 a.m.
    • AM_12

      public static final TIME AM_12
      noon
    • PM_3

      public static final TIME PM_3
      3:00 p.m.
    • PM_6

      public static final TIME PM_6
      6:00 p.m.
    • PM_9

      public static final TIME PM_9
      9:00 p.m.
    • PM_12

      public static final TIME PM_12
      midnight
    • ALL

      public static final TIME ALL
      all times
  • Method Details

    • values

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

      public static TIME valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getIndex

      public static int getIndex​(TIME time)
      case PM_12 -> 0; case AM_3 -> 1; case AM_6 -> 2; case AM_9 -> 3; case AM_12 -> 4; case PM_3 -> 5; case PM_6 -> 6; case PM_9 -> 7; case ALL -> -1;
      Parameters:
      time - TIME
      Returns:
      its index
    • getAllEnumsExcept

      public static List<TIME> getAllEnumsExcept​(@NotNull TIME time)
      returns all TIME values expect the one included in param
      Parameters:
      time - TIME to be excluded
      Returns:
      List of all TIMEs except param