TimeSpan Class

  • java.lang.Object
    • com.azure.resourcemanager.containerservice.models.TimeSpan

Implements

public final class TimeSpan
implements JsonSerializable<TimeSpan>

A time range. For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z.

Constructor Summary

Constructor Description
TimeSpan()

Creates an instance of TimeSpan class.

Method Summary

Modifier and Type Method and Description
OffsetDateTime end()

Get the end property: The end of a time span.

static TimeSpan fromJson(JsonReader jsonReader)

Reads an instance of TimeSpan from the JsonReader.

OffsetDateTime start()

Get the start property: The start of a time span.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

TimeSpan withEnd(OffsetDateTime end)

Set the end property: The end of a time span.

TimeSpan withStart(OffsetDateTime start)

Set the start property: The start of a time span.

Methods inherited from java.lang.Object

Constructor Details

TimeSpan

public TimeSpan()

Creates an instance of TimeSpan class.

Method Details

end

public OffsetDateTime end()

Get the end property: The end of a time span.

Returns:

the end value.

fromJson

public static TimeSpan fromJson(JsonReader jsonReader)

Reads an instance of TimeSpan from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of TimeSpan if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the TimeSpan.

start

public OffsetDateTime start()

Get the start property: The start of a time span.

Returns:

the start value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withEnd

public TimeSpan withEnd(OffsetDateTime end)

Set the end property: The end of a time span.

Parameters:

end - the end value to set.

Returns:

the TimeSpan object itself.

withStart

public TimeSpan withStart(OffsetDateTime start)

Set the start property: The start of a time span.

Parameters:

start - the start value to set.

Returns:

the TimeSpan object itself.

Applies to