Class Duration


  • public class Duration
    extends Object
    Duration
    • Constructor Detail

      • Duration

        public Duration()
    • Method Detail

      • unit

        public Duration unit​(Duration.UnitEnum unit)
        The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months**
        Parameters:
        unit -
        Returns:
        the current Duration instance, allowing for method chaining
      • getUnit

        public Duration.UnitEnum getUnit()
        The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months**
        Returns:
        unit
      • setUnit

        public void setUnit​(Duration.UnitEnum unit)
        The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months**
        Parameters:
        unit -
      • value

        public Duration value​(Integer value)
        The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months.
        Parameters:
        value -
        Returns:
        the current Duration instance, allowing for method chaining
      • getValue

        public Integer getValue()
        The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months.
        Returns:
        value
      • setValue

        public void setValue​(Integer value)
        The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months.
        Parameters:
        value -
      • equals

        public boolean equals​(Object o)
        Return true if this Duration object is equal to o.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • fromJson

        public static Duration fromJson​(String jsonString)
                                 throws com.fasterxml.jackson.core.JsonProcessingException
        Create an instance of Duration given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of Duration
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if the JSON string is invalid with respect to Duration
      • toJson

        public String toJson()
                      throws com.fasterxml.jackson.core.JsonProcessingException
        Convert an instance of Duration to an JSON string
        Returns:
        JSON string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException