com.azure.resourcemanager.resourcehealth.models.Faq 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.resourcehealth.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;
/**
* Frequently asked question for the service health event.
*/
@Fluent
public final class Faq implements JsonSerializable {
/*
* FAQ question for the service health event.
*/
private String question;
/*
* FAQ answer for the service health event.
*/
private String answer;
/*
* FAQ locale for the service health event.
*/
private String localeCode;
/**
* Creates an instance of Faq class.
*/
public Faq() {
}
/**
* Get the question property: FAQ question for the service health event.
*
* @return the question value.
*/
public String question() {
return this.question;
}
/**
* Set the question property: FAQ question for the service health event.
*
* @param question the question value to set.
* @return the Faq object itself.
*/
public Faq withQuestion(String question) {
this.question = question;
return this;
}
/**
* Get the answer property: FAQ answer for the service health event.
*
* @return the answer value.
*/
public String answer() {
return this.answer;
}
/**
* Set the answer property: FAQ answer for the service health event.
*
* @param answer the answer value to set.
* @return the Faq object itself.
*/
public Faq withAnswer(String answer) {
this.answer = answer;
return this;
}
/**
* Get the localeCode property: FAQ locale for the service health event.
*
* @return the localeCode value.
*/
public String localeCode() {
return this.localeCode;
}
/**
* Set the localeCode property: FAQ locale for the service health event.
*
* @param localeCode the localeCode value to set.
* @return the Faq object itself.
*/
public Faq withLocaleCode(String localeCode) {
this.localeCode = localeCode;
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("question", this.question);
jsonWriter.writeStringField("answer", this.answer);
jsonWriter.writeStringField("localeCode", this.localeCode);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of Faq from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of Faq 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 Faq.
*/
public static Faq fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
Faq deserializedFaq = new Faq();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("question".equals(fieldName)) {
deserializedFaq.question = reader.getString();
} else if ("answer".equals(fieldName)) {
deserializedFaq.answer = reader.getString();
} else if ("localeCode".equals(fieldName)) {
deserializedFaq.localeCode = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedFaq;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy