QueryTimeInterval Class
- java.
lang. Object - com.
azure. monitor. query. models. QueryTimeInterval
- com.
public final class QueryTimeInterval
Class to represent a time interval. Time intervals are inclusive at the start time and exclusive at the end time.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
|
static final
Query |
ALL
Time interval of all time. |
|
static final
Query |
LAST_12_HOURS
Time interval of the last 12 hours. |
|
static final
Query |
LAST_1_HOUR
Time interval of the last hour. |
|
static final
Query |
LAST_2_DAYS
Time interval of the last 2 days. |
|
static final
Query |
LAST_30_MINUTES
Time interval of the last 30 minutes. |
|
static final
Query |
LAST_3_DAYS
Time interval of the last 3 days. |
|
static final
Query |
LAST_4_HOURS
Time interval of the last 4 hours. |
|
static final
Query |
LAST_5_MINUTES
Time interval of the last 5 minutes. |
|
static final
Query |
LAST_7_DAYS
Time interval of the last 7 days. |
|
static final
Query |
LAST_DAY
Time interval of the last day. |
Constructor Summary
| Constructor | Description |
|---|---|
| QueryTimeInterval(Duration duration) |
Creates an instance of QueryTimeInterval using the provided duration. |
| QueryTimeInterval(OffsetDateTime startTime, Duration duration) |
Creates an instance of QueryTimeInterval using the start and end duration of the interval. |
| QueryTimeInterval(OffsetDateTime startTime, OffsetDateTime endTime) |
Creates an instance of QueryTimeInterval using the start and end OffsetDateTimes. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| boolean | equals(Object o) |
| Duration |
getDuration()
Returns the duration of this QueryTimeInterval instance. |
|
Offset |
getEndTime()
Returns the end time of this QueryTimeInterval instance. |
|
Offset |
getStartTime()
Returns the start time of this QueryTimeInterval instance. |
| int | hashCode() |
|
static
Query |
parse(String value)
This method takes an ISO 8601 formatted time interval string and returns an instance of QueryTimeInterval. |
| String | toString() |
Methods inherited from java.lang.Object
Field Details
ALL
public static final QueryTimeInterval ALL
Time interval of all time.
LAST_12_HOURS
public static final QueryTimeInterval LAST_12_HOURS
Time interval of the last 12 hours.
LAST_1_HOUR
public static final QueryTimeInterval LAST_1_HOUR
Time interval of the last hour.
LAST_2_DAYS
public static final QueryTimeInterval LAST_2_DAYS
Time interval of the last 2 days.
LAST_30_MINUTES
public static final QueryTimeInterval LAST_30_MINUTES
Time interval of the last 30 minutes.
LAST_3_DAYS
public static final QueryTimeInterval LAST_3_DAYS
Time interval of the last 3 days.
LAST_4_HOURS
public static final QueryTimeInterval LAST_4_HOURS
Time interval of the last 4 hours.
LAST_5_MINUTES
public static final QueryTimeInterval LAST_5_MINUTES
Time interval of the last 5 minutes.
LAST_7_DAYS
public static final QueryTimeInterval LAST_7_DAYS
Time interval of the last 7 days.
LAST_DAY
public static final QueryTimeInterval LAST_DAY
Time interval of the last day.
Constructor Details
QueryTimeInterval
public QueryTimeInterval(Duration duration)
Creates an instance of QueryTimeInterval using the provided duration. The duration is the interval that starts from the provided duration and ends at the current time.
Parameters:
QueryTimeInterval
public QueryTimeInterval(OffsetDateTime startTime, Duration duration)
Creates an instance of QueryTimeInterval using the start and end duration of the interval.
Parameters:
QueryTimeInterval
public QueryTimeInterval(OffsetDateTime startTime, OffsetDateTime endTime)
Creates an instance of QueryTimeInterval using the start and end OffsetDateTimes.
Parameters:
Method Details
equals
public boolean equals(Object o)
Overrides:
QueryTimeInterval.equals(Object o)Parameters:
getDuration
public Duration getDuration()
Returns the duration of this QueryTimeInterval instance.
Returns:
getEndTime
public OffsetDateTime getEndTime()
Returns the end time of this QueryTimeInterval instance.
Returns:
getStartTime
public OffsetDateTime getStartTime()
Returns the start time of this QueryTimeInterval instance.
Returns:
hashCode
public int hashCode()
Overrides:
QueryTimeInterval.hashCode()parse
public static QueryTimeInterval parse(String value)
This method takes an ISO 8601 formatted time interval string and returns an instance of QueryTimeInterval.
Parameters:
Returns:
toString
public String toString()
Overrides:
QueryTimeInterval.toString()