Enum Class TimeUnitProperty

java.lang.Object
java.lang.Enum<TimeUnitProperty>
com.j_spaces.kernel.TimeUnitProperty
All Implemented Interfaces:
Serializable, Comparable<TimeUnitProperty>, java.lang.constant.Constable

public enum TimeUnitProperty extends Enum<TimeUnitProperty>
Helper class that converts time interval property to milliseconds long value, according to the given time unit format ms - milliseconds s - seconds m - minutes h - hours
Since:
6.1
Author:
anna
  • Enum Constant Details

  • Method Details

    • values

      public static TimeUnitProperty[] 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 TimeUnitProperty 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
    • getProperty

      public static long getProperty(String key, String def)
      Get the property from the system properties and parse it according the matching pattern. Default time unit is seconds
      Returns:
      system property according the matching pattern
    • getProperty

      public static long getProperty(String key, String def, TimeUnitProperty defaultTimeUnit)
      Get the property from the system properties and parse it according the matching pattern
      Returns:
      timeValue
    • getParsedValue

      public static long getParsedValue(String time, TimeUnitProperty defaultTimeUnit)
      Parse the time using the provided TimeUnitProperty. This method does not get the value from system properties but instead uses the passed value and returns a long representation.
    • getParsedValue

      public static long getParsedValue(String time)