public final class TimeInterval extends Object
Modifier and Type | Field and Description |
---|---|
static TimeInterval |
ALL |
static TimeInterval |
LAST_1_HOUR |
static TimeInterval |
LAST_12_HOURS |
static TimeInterval |
LAST_2_DAYS |
static TimeInterval |
LAST_3_DAYS |
static TimeInterval |
LAST_30_MINUTES |
static TimeInterval |
LAST_4_HOURS |
static TimeInterval |
LAST_5_MINUTES |
static TimeInterval |
LAST_7_DAYS |
static TimeInterval |
LAST_DAY |
Constructor and Description |
---|
TimeInterval(Duration duration)
Creates an instance of
TimeInterval using the provided duration. |
TimeInterval(OffsetDateTime startTime,
Duration duration)
Creates an instance of
TimeInterval using the start and end duration of the interval. |
TimeInterval(OffsetDateTime startTime,
OffsetDateTime endTime)
Creates an instance of
TimeInterval using the start and end OffsetDateTimes . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Duration |
getDuration()
Returns the duration of this
TimeInterval instance. |
OffsetDateTime |
getEndTime()
Returns the end time of this
TimeInterval instance. |
OffsetDateTime |
getStartTime()
Returns the start time of this
TimeInterval instance. |
int |
hashCode() |
static TimeInterval |
parse(String value)
This method takes an ISO 8601 formatted time interval string and returns an instance of
TimeInterval . |
String |
toIso8601Format()
Returns this
TimeInterval in ISO 8601 string format. |
String |
toString() |
public static final TimeInterval ALL
public static final TimeInterval LAST_5_MINUTES
public static final TimeInterval LAST_30_MINUTES
public static final TimeInterval LAST_1_HOUR
public static final TimeInterval LAST_4_HOURS
public static final TimeInterval LAST_12_HOURS
public static final TimeInterval LAST_DAY
public static final TimeInterval LAST_2_DAYS
public static final TimeInterval LAST_3_DAYS
public static final TimeInterval LAST_7_DAYS
public TimeInterval(Duration duration)
TimeInterval
using the provided duration. The duration is the interval that starts
from the provided duration and ends at the current time.duration
- the duration for this query time span.public TimeInterval(OffsetDateTime startTime, OffsetDateTime endTime)
TimeInterval
using the start and end OffsetDateTimes
.startTime
- The start time of the interval.endTime
- The end time of the interval.public TimeInterval(OffsetDateTime startTime, Duration duration)
TimeInterval
using the start and end duration of the interval.startTime
- The start time of the interval.duration
- The end duration of the interval.public Duration getDuration()
TimeInterval
instance.TimeInterval
instance.public OffsetDateTime getStartTime()
TimeInterval
instance.TimeInterval
instance.public OffsetDateTime getEndTime()
TimeInterval
instance.TimeInterval
instance.public String toIso8601Format()
TimeInterval
in ISO 8601 string format.TimeInterval
instance.public static TimeInterval parse(String value)
TimeInterval
.value
- The ISO 8601 formatted time interval string.TimeInterval
.IllegalArgumentException
- if value
is not in the correct format.Copyright © 2021 Microsoft Corporation. All rights reserved.