![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.desktopvirtualization.models.MaintenanceWindowPatchProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-desktopvirtualization Show documentation
Show all versions of azure-resourcemanager-desktopvirtualization Show documentation
This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-04.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.desktopvirtualization.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Maintenance window starting hour and day of week.
*/
@Fluent
public final class MaintenanceWindowPatchProperties implements JsonSerializable {
/*
* The update start hour of the day. (0 - 23)
*/
private Integer hour;
/*
* Day of the week.
*/
private DayOfWeek dayOfWeek;
/**
* Creates an instance of MaintenanceWindowPatchProperties class.
*/
public MaintenanceWindowPatchProperties() {
}
/**
* Get the hour property: The update start hour of the day. (0 - 23).
*
* @return the hour value.
*/
public Integer hour() {
return this.hour;
}
/**
* Set the hour property: The update start hour of the day. (0 - 23).
*
* @param hour the hour value to set.
* @return the MaintenanceWindowPatchProperties object itself.
*/
public MaintenanceWindowPatchProperties withHour(Integer hour) {
this.hour = hour;
return this;
}
/**
* Get the dayOfWeek property: Day of the week.
*
* @return the dayOfWeek value.
*/
public DayOfWeek dayOfWeek() {
return this.dayOfWeek;
}
/**
* Set the dayOfWeek property: Day of the week.
*
* @param dayOfWeek the dayOfWeek value to set.
* @return the MaintenanceWindowPatchProperties object itself.
*/
public MaintenanceWindowPatchProperties withDayOfWeek(DayOfWeek dayOfWeek) {
this.dayOfWeek = dayOfWeek;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeNumberField("hour", this.hour);
jsonWriter.writeStringField("dayOfWeek", this.dayOfWeek == null ? null : this.dayOfWeek.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MaintenanceWindowPatchProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MaintenanceWindowPatchProperties 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 MaintenanceWindowPatchProperties.
*/
public static MaintenanceWindowPatchProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MaintenanceWindowPatchProperties deserializedMaintenanceWindowPatchProperties
= new MaintenanceWindowPatchProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("hour".equals(fieldName)) {
deserializedMaintenanceWindowPatchProperties.hour = reader.getNullable(JsonReader::getInt);
} else if ("dayOfWeek".equals(fieldName)) {
deserializedMaintenanceWindowPatchProperties.dayOfWeek = DayOfWeek.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedMaintenanceWindowPatchProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy