Record Class TimeDurationRecord

java.lang.Object
java.lang.Record
com.oracle.truffle.js.runtime.builtins.temporal.TimeDurationRecord

public record TimeDurationRecord(double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds) extends Record
CreateTimeDurationRecord result.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TimeDurationRecord(double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds)
    Creates an instance of a TimeDurationRecord record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the days record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the hours record component.
    double
    Returns the value of the microseconds record component.
    double
    Returns the value of the milliseconds record component.
    double
    Returns the value of the minutes record component.
    double
    Returns the value of the nanoseconds record component.
    double
    Returns the value of the seconds record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TimeDurationRecord

      public TimeDurationRecord(double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds)
      Creates an instance of a TimeDurationRecord record class.
      Parameters:
      days - the value for the days record component
      hours - the value for the hours record component
      minutes - the value for the minutes record component
      seconds - the value for the seconds record component
      milliseconds - the value for the milliseconds record component
      microseconds - the value for the microseconds record component
      nanoseconds - the value for the nanoseconds record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • days

      public double days()
      Returns the value of the days record component.
      Returns:
      the value of the days record component
    • hours

      public double hours()
      Returns the value of the hours record component.
      Returns:
      the value of the hours record component
    • minutes

      public double minutes()
      Returns the value of the minutes record component.
      Returns:
      the value of the minutes record component
    • seconds

      public double seconds()
      Returns the value of the seconds record component.
      Returns:
      the value of the seconds record component
    • milliseconds

      public double milliseconds()
      Returns the value of the milliseconds record component.
      Returns:
      the value of the milliseconds record component
    • microseconds

      public double microseconds()
      Returns the value of the microseconds record component.
      Returns:
      the value of the microseconds record component
    • nanoseconds

      public double nanoseconds()
      Returns the value of the nanoseconds record component.
      Returns:
      the value of the nanoseconds record component