Module org.jooq

Class DayToSecond

    • Constructor Detail

      • DayToSecond

        public DayToSecond()
        Create a new interval.
      • DayToSecond

        public DayToSecond​(int days)
        Create a new day interval.
      • DayToSecond

        public DayToSecond​(int days,
                           int hours)
        Create a new day-hour interval.
      • DayToSecond

        public DayToSecond​(int days,
                           int hours,
                           int minutes)
        Create a new day-minute interval.
      • DayToSecond

        public DayToSecond​(int days,
                           int hours,
                           int minutes,
                           int seconds)
        Create a new day-second interval.
      • DayToSecond

        public DayToSecond​(int days,
                           int hours,
                           int minutes,
                           int seconds,
                           int nano)
        Create a new day-nanoseconds interval.
    • Method Detail

      • valueOf

        public static DayToSecond valueOf​(String string)
        Parse a string representation of a INTERVAL DAY TO SECOND.
        Parameters:
        string - A string representation of the form [+|-][days] [hours]:[minutes]:[seconds].[fractional seconds]
        Returns:
        The parsed INTERVAL DAY TO SECOND object, or null if the string could not be parsed.
      • day

        public static DayToSecond day​(String string)
        Parse a string representation of a INTERVAL DAY TO HOUR.
        Parameters:
        string - A string representation of the form [+|-][days]
        Returns:
        The parsed INTERVAL DAY object, or null if the string could not be parsed.
      • dayToHour

        public static DayToSecond dayToHour​(String string)
        Parse a string representation of a INTERVAL DAY TO HOUR.
        Parameters:
        string - A string representation of the form [+|-][days] [hours]
        Returns:
        The parsed INTERVAL DAY TO HOUR object, or null if the string could not be parsed.
      • dayToMinute

        public static DayToSecond dayToMinute​(String string)
        Parse a string representation of a INTERVAL DAY TO MINUTE.
        Parameters:
        string - A string representation of the form [+|-][days] [hours]:[minutes]
        Returns:
        The parsed INTERVAL DAY TO MINUTE object, or null if the string could not be parsed.
      • dayToSecond

        public static DayToSecond dayToSecond​(String string)
        Parse a string representation of a INTERVAL DAY TO SECOND.
        Parameters:
        string - A string representation of the form [+|-][days] [hours]:[minutes]:[seconds].[fractional seconds]
        Returns:
        The parsed INTERVAL DAY TO MINUTE object, or null if the string could not be parsed.
      • hour

        public static DayToSecond hour​(String string)
        Parse a string representation of a INTERVAL HOUR.
        Parameters:
        string - A string representation of the form [+|-][hours]
        Returns:
        The parsed INTERVAL HOUR object, or null if the string could not be parsed.
      • hourToMinute

        public static DayToSecond hourToMinute​(String string)
        Parse a string representation of a INTERVAL HOUR TO MINUTE.
        Parameters:
        string - A string representation of the form [+|-][hours]:[minutes]
        Returns:
        The parsed INTERVAL HOUR TO MINUTE object, or null if the string could not be parsed.
      • hourToSecond

        public static DayToSecond hourToSecond​(String string)
        Parse a string representation of a INTERVAL HOUR TO SECOND.
        Parameters:
        string - A string representation of the form [+|-][hours]:[minutes]:[seconds].[fractional seconds]
        Returns:
        The parsed INTERVAL HOUR TO SECOND object, or null if the string could not be parsed.
      • minute

        public static DayToSecond minute​(String string)
        Parse a string representation of a INTERVAL MINUTE.
        Parameters:
        string - A string representation of the form [+|-][minutes]
        Returns:
        The parsed INTERVAL MINUTE object, or null if the string could not be parsed.
      • minuteToSecond

        public static DayToSecond minuteToSecond​(String string)
        Parse a string representation of a INTERVAL MINUTE TO SECOND.
        Parameters:
        string - A string representation of the form [+|-][[minutes]:[seconds].[fractional seconds]
        Returns:
        The parsed INTERVAL MINUTE TO SECOND object, or null if the string could not be parsed.
      • second

        public static DayToSecond second​(String string)
        Parse a string representation of a INTERVAL SECOND.
        Parameters:
        string - A string representation of the form [+|-][seconds].[fractional seconds]
        Returns:
        The parsed INTERVAL SECOND object, or null if the string could not be parsed.
      • valueOf

        public static DayToSecond valueOf​(double milli)
        Load a Double representation of a INTERVAL DAY TO SECOND by assuming standard 24 hour days and 60 second minutes.
        Parameters:
        milli - The number of milliseconds as a fractional number
        Returns:
        The loaded INTERVAL DAY TO SECOND object
      • valueOf

        public static DayToSecond valueOf​(long second,
                                          int nanos)
        Load a Double representation of a INTERVAL DAY TO SECOND by assuming standard 24 hour days and 60 second minutes.
        Parameters:
        second - The number of seconds
        nanos - The number of nano seconds
        Returns:
        The loaded INTERVAL DAY TO SECOND object
      • toDuration

        public final Duration toDuration()
        Description copied from interface: Interval
        Get a duration representation of this interval.

        There is an obvious Duration representation for DayToSecond intervals. If the interval contains YearMonth information, then the corresponding duration will use:

        • 1 year = 365.25 days
        • 1 month = 30 days

        This corresponds to PostgreSQL's EXTRACT(EPOCH FROM my_interval) behaviour.

        Specified by:
        toDuration in interface Interval
      • neg

        public final DayToSecond neg()
        Description copied from interface: Interval
        Negate the interval (change its sign)
        Specified by:
        neg in interface Interval
      • abs

        public final DayToSecond abs()
        Description copied from interface: Interval
        Get the absolute value of the interval (set its sign to positive)
        Specified by:
        abs in interface Interval
      • getDays

        public final int getDays()
        Get the day-part of this interval
      • getHours

        public final int getHours()
        Get the hour-part of this interval
      • getMinutes

        public final int getMinutes()
        Get the minute-part of this interval
      • getSeconds

        public final int getSeconds()
        Get the second-part of this interval
      • getMilli

        public final int getMilli()
        Get the (truncated) milli-part of this interval
      • getMicro

        public final int getMicro()
        Get the (truncated) micro-part of this interval
      • getNano

        public final int getNano()
        Get the nano-part of this interval
      • getTotalDays

        public final double getTotalDays()
        Get the whole interval in days
      • getTotalHours

        public final double getTotalHours()
        Get the whole interval in hours
      • getTotalMinutes

        public final double getTotalMinutes()
        Get the whole interval in minutes
      • getTotalSeconds

        public final double getTotalSeconds()
        Get the whole interval in seconds
      • getTotalMilli

        public final double getTotalMilli()
        Get the whole interval in milli-seconds
      • getTotalMicro

        public final double getTotalMicro()
        Get the whole interval in micro-seconds
      • getTotalNano

        public final double getTotalNano()
        Get the whole interval in nano-seconds
      • getSign

        public final int getSign()
        Description copied from interface: Interval
        The sign of the interval
        Specified by:
        getSign in interface Interval
        Returns:
        1 for positive or zero, -1 for negative
      • hashCode

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

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object