Class TimeInterval

java.lang.Object
de.fraunhofer.iosb.ilt.frostclient.models.ext.TimeInterval
All Implemented Interfaces:
ComplexValue<TimeInterval>, TimeObject

public class TimeInterval extends Object implements TimeObject, ComplexValue<TimeInterval>
Represent an ISO8601 time interval.
  • Field Details

  • Constructor Details

    • TimeInterval

      public TimeInterval()
    • TimeInterval

      public TimeInterval(net.time4j.range.MomentInterval interval)
  • Method Details

    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • create

      public static TimeInterval create(net.time4j.Moment start, net.time4j.Moment end)
    • create

      public static TimeInterval create(Instant start, Instant end)
    • create

      public static TimeInterval create(ZonedDateTime start, ZonedDateTime end)
    • parse

      public static TimeInterval parse(String value)
    • getInterval

      public net.time4j.range.MomentInterval getInterval()
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface TimeObject
    • asISO8601

      public String asISO8601()
      Specified by:
      asISO8601 in interface TimeObject
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProperty

      public <P> P getProperty(Property<P> property)
      Description copied from interface: ComplexValue
      Get the value of the given property.
      Specified by:
      getProperty in interface ComplexValue<TimeInterval>
      Type Parameters:
      P - The type of the property and value.
      Parameters:
      property - The property to get the value of.
      Returns:
      the value of the requested property.
    • setProperty

      public TimeInterval setProperty(Property property, Object value)
      Description copied from interface: ComplexValue
      Set the given property to the given value.
      Specified by:
      setProperty in interface ComplexValue<TimeInterval>
      Parameters:
      property - The property to set.
      value - The value to set the property to.
      Returns:
      this.
    • getStart

      public net.time4j.Moment getStart()
    • getEnd

      public net.time4j.Moment getEnd()
    • getProperty

      public Object getProperty(String name)
      Description copied from interface: ComplexValue
      Get the custom property with the given name. Only valid for ComplexTypes that are classed as openType, returns null for non-openTypes.
      Specified by:
      getProperty in interface ComplexValue<TimeInterval>
      Parameters:
      name - The name of the custom property to fetch.
      Returns:
      The value of the custom property.
    • setProperty

      public TimeInterval setProperty(String name, Object value)
      Description copied from interface: ComplexValue
      Set the custom property with the given name to the given value. Only valid for ComplexTypes that are classed as openType.
      Specified by:
      setProperty in interface ComplexValue<TimeInterval>
      Parameters:
      name - The name of the custom property to set.
      value - The value of the custom property to set.
      Returns:
      this.