DateSpan Class

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

Implements

public final class DateSpan
implements JsonSerializable<DateSpan>

A date range. For example, between '2022-12-23' and '2023-01-05'.

Constructor Summary

Constructor Description
DateSpan()

Creates an instance of DateSpan class.

Method Summary

Modifier and Type Method and Description
LocalDate end()

Get the end property: The end date of the date span.

static DateSpan fromJson(JsonReader jsonReader)

Reads an instance of DateSpan from the JsonReader.

LocalDate start()

Get the start property: The start date of the date span.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

DateSpan withEnd(LocalDate end)

Set the end property: The end date of the date span.

DateSpan withStart(LocalDate start)

Set the start property: The start date of the date span.

Methods inherited from java.lang.Object

Constructor Details

DateSpan

public DateSpan()

Creates an instance of DateSpan class.

Method Details

end

public LocalDate end()

Get the end property: The end date of the date span.

Returns:

the end value.

fromJson

public static DateSpan fromJson(JsonReader jsonReader)

Reads an instance of DateSpan from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

start

public LocalDate start()

Get the start property: The start date of the date span.

Returns:

the start value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withEnd

public DateSpan withEnd(LocalDate end)

Set the end property: The end date of the date span.

Parameters:

end - the end value to set.

Returns:

the DateSpan object itself.

withStart

public DateSpan withStart(LocalDate start)

Set the start property: The start date of the date span.

Parameters:

start - the start value to set.

Returns:

the DateSpan object itself.

Applies to