Package com.azure.monitor.query.models
Class QueryTimeInterval
java.lang.Object
com.azure.monitor.query.models.QueryTimeInterval
Class to represent a time interval.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final QueryTimeInterval
Time interval of all time.static final QueryTimeInterval
Time interval of the last hour.static final QueryTimeInterval
Time interval of the last 12 hours.static final QueryTimeInterval
Time interval of the last 2 days.static final QueryTimeInterval
Time interval of the last 3 days.static final QueryTimeInterval
Time interval of the last 30 minutes.static final QueryTimeInterval
Time interval of the last 4 hours.static final QueryTimeInterval
Time interval of the last 5 minutes.static final QueryTimeInterval
Time interval of the last 7 days.static final QueryTimeInterval
Time interval of the last day. -
Constructor Summary
ConstructorDescriptionQueryTimeInterval
(Duration duration) Creates an instance ofQueryTimeInterval
using the provided duration.QueryTimeInterval
(OffsetDateTime startTime, Duration duration) Creates an instance ofQueryTimeInterval
using the start and end duration of the interval.QueryTimeInterval
(OffsetDateTime startTime, OffsetDateTime endTime) Creates an instance ofQueryTimeInterval
using the start and endOffsetDateTimes
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the duration of thisQueryTimeInterval
instance.Returns the end time of thisQueryTimeInterval
instance.Returns the start time of thisQueryTimeInterval
instance.int
hashCode()
static QueryTimeInterval
This method takes an ISO 8601 formatted time interval string and returns an instance ofQueryTimeInterval
.toString()
-
Field Details
-
ALL
Time interval of all time. -
LAST_5_MINUTES
Time interval of the last 5 minutes. -
LAST_30_MINUTES
Time interval of the last 30 minutes. -
LAST_1_HOUR
Time interval of the last hour. -
LAST_4_HOURS
Time interval of the last 4 hours. -
LAST_12_HOURS
Time interval of the last 12 hours. -
LAST_DAY
Time interval of the last day. -
LAST_2_DAYS
Time interval of the last 2 days. -
LAST_3_DAYS
Time interval of the last 3 days. -
LAST_7_DAYS
Time interval of the last 7 days.
-
-
Constructor Details
-
QueryTimeInterval
Creates an instance ofQueryTimeInterval
using the provided duration. The duration is the interval that starts from the provided duration and ends at the current time.- Parameters:
duration
- the duration for this query time span.
-
QueryTimeInterval
Creates an instance ofQueryTimeInterval
using the start and endOffsetDateTimes
.- Parameters:
startTime
- The start time of the interval.endTime
- The end time of the interval.
-
QueryTimeInterval
Creates an instance ofQueryTimeInterval
using the start and end duration of the interval.- Parameters:
startTime
- The start time of the interval.duration
- The end duration of the interval.
-
-
Method Details
-
getDuration
Returns the duration of thisQueryTimeInterval
instance.- Returns:
- the duration of this
QueryTimeInterval
instance.
-
getStartTime
Returns the start time of thisQueryTimeInterval
instance.- Returns:
- the start time of this
QueryTimeInterval
instance.
-
getEndTime
Returns the end time of thisQueryTimeInterval
instance.- Returns:
- the end time of this
QueryTimeInterval
instance.
-
parse
This method takes an ISO 8601 formatted time interval string and returns an instance ofQueryTimeInterval
.- Parameters:
value
- The ISO 8601 formatted time interval string.- Returns:
- An instance of
QueryTimeInterval
. - Throws:
IllegalArgumentException
- ifvalue
is not in the correct format.
-
toString
-
equals
-
hashCode
public int hashCode()
-