![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.automation.models.ScheduleAssociationProperty Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.automation.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;
/**
* The schedule property associated with the entity.
*/
@Fluent
public final class ScheduleAssociationProperty implements JsonSerializable {
/*
* Gets or sets the name of the Schedule.
*/
private String name;
/**
* Creates an instance of ScheduleAssociationProperty class.
*/
public ScheduleAssociationProperty() {
}
/**
* Get the name property: Gets or sets the name of the Schedule.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: Gets or sets the name of the Schedule.
*
* @param name the name value to set.
* @return the ScheduleAssociationProperty object itself.
*/
public ScheduleAssociationProperty withName(String name) {
this.name = name;
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.writeStringField("name", this.name);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ScheduleAssociationProperty from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ScheduleAssociationProperty 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 ScheduleAssociationProperty.
*/
public static ScheduleAssociationProperty fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ScheduleAssociationProperty deserializedScheduleAssociationProperty = new ScheduleAssociationProperty();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedScheduleAssociationProperty.name = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedScheduleAssociationProperty;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy