Class Duration
java.lang.Object
com.microsoft.applicationinsights.telemetry.Duration
This class lets its users define an interval of time which can be defined in terms of days,
hours, minutes, seconds and milliseconds.
It has various constructors to let the user easily define an interval of time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonggetDays()Gets the days part of the duration.intgetHours()Gets the hours part of the duration.intGets the milliseconds part of the duration.intGets the minutes part of the duration.intGets the seconds part of the duration.longGets the total milliseconds of the duration.inthashCode()toString()
-
Constructor Details
-
Duration
public Duration(long days, int hours, int minutes, int seconds, int milliseconds) The interval is set by setting all the possible values.- Parameters:
days- Day(s).hours- Hour(s) in range [-23, 23].minutes- Minute(s) in range [-59, 59].seconds- Second(s) in range [-59, 59].milliseconds- Milliseconds in range [0, 999].
-
Duration
public Duration(long duration) The duration is defined by milliseconds. The class will calculate the number of days, hours, minutes, seconds and milliseconds from that value.- Parameters:
duration- The duration in milliseconds.
-
-
Method Details
-
getDays
public long getDays()Gets the days part of the duration. -
getHours
public int getHours()Gets the hours part of the duration. -
getMinutes
public int getMinutes()Gets the minutes part of the duration. -
getSeconds
public int getSeconds()Gets the seconds part of the duration. -
getMilliseconds
public int getMilliseconds()Gets the milliseconds part of the duration. -
getTotalMilliseconds
public long getTotalMilliseconds()Gets the total milliseconds of the duration. -
toString
-
equals
-
hashCode
public int hashCode()
-