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
FieldsModifier and TypeFieldDescriptionstatic final QueryTimeIntervalTime interval of all time.static final QueryTimeIntervalTime interval of the last hour.static final QueryTimeIntervalTime interval of the last 12 hours.static final QueryTimeIntervalTime interval of the last 2 days.static final QueryTimeIntervalTime interval of the last 3 days.static final QueryTimeIntervalTime interval of the last 30 minutes.static final QueryTimeIntervalTime interval of the last 4 hours.static final QueryTimeIntervalTime interval of the last 5 minutes.static final QueryTimeIntervalTime interval of the last 7 days.static final QueryTimeIntervalTime interval of the last day. -
Constructor Summary
ConstructorsConstructorDescriptionQueryTimeInterval(Duration duration) Creates an instance ofQueryTimeIntervalusing the provided duration.QueryTimeInterval(OffsetDateTime startTime, Duration duration) Creates an instance ofQueryTimeIntervalusing the start and end duration of the interval.QueryTimeInterval(OffsetDateTime startTime, OffsetDateTime endTime) Creates an instance ofQueryTimeIntervalusing the start and endOffsetDateTimes. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the duration of thisQueryTimeIntervalinstance.Returns the end time of thisQueryTimeIntervalinstance.Returns the start time of thisQueryTimeIntervalinstance.inthashCode()static QueryTimeIntervalThis 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 ofQueryTimeIntervalusing 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 ofQueryTimeIntervalusing the start and endOffsetDateTimes.- Parameters:
startTime- The start time of the interval.endTime- The end time of the interval.
-
QueryTimeInterval
Creates an instance ofQueryTimeIntervalusing 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 thisQueryTimeIntervalinstance.- Returns:
- the duration of this
QueryTimeIntervalinstance.
-
getStartTime
Returns the start time of thisQueryTimeIntervalinstance.- Returns:
- the start time of this
QueryTimeIntervalinstance.
-
getEndTime
Returns the end time of thisQueryTimeIntervalinstance.- Returns:
- the end time of this
QueryTimeIntervalinstance.
-
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- ifvalueis not in the correct format.
-
toString
-
equals
-
hashCode
public int hashCode()
-