com.azure.resourcemanager.advisor.fluent.models.MetadataEntityInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-advisor Show documentation
Show all versions of azure-resourcemanager-advisor Show documentation
This package contains Microsoft Azure SDK for Advisor Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST APIs for Azure Advisor. Package tag package-2020-01.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.advisor.fluent.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 com.azure.resourcemanager.advisor.models.MetadataSupportedValueDetail;
import com.azure.resourcemanager.advisor.models.Scenario;
import java.io.IOException;
import java.util.List;
/**
* The metadata entity contract.
*/
@Fluent
public final class MetadataEntityInner implements JsonSerializable {
/*
* The resource Id of the metadata entity.
*/
private String id;
/*
* The type of the metadata entity.
*/
private String type;
/*
* The name of the metadata entity.
*/
private String name;
/*
* The metadata entity properties.
*/
private MetadataEntityProperties innerProperties;
/**
* Creates an instance of MetadataEntityInner class.
*/
public MetadataEntityInner() {
}
/**
* Get the id property: The resource Id of the metadata entity.
*
* @return the id value.
*/
public String id() {
return this.id;
}
/**
* Set the id property: The resource Id of the metadata entity.
*
* @param id the id value to set.
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withId(String id) {
this.id = id;
return this;
}
/**
* Get the type property: The type of the metadata entity.
*
* @return the type value.
*/
public String type() {
return this.type;
}
/**
* Set the type property: The type of the metadata entity.
*
* @param type the type value to set.
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withType(String type) {
this.type = type;
return this;
}
/**
* Get the name property: The name of the metadata entity.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: The name of the metadata entity.
*
* @param name the name value to set.
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withName(String name) {
this.name = name;
return this;
}
/**
* Get the innerProperties property: The metadata entity properties.
*
* @return the innerProperties value.
*/
private MetadataEntityProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the displayName property: The display name.
*
* @return the displayName value.
*/
public String displayName() {
return this.innerProperties() == null ? null : this.innerProperties().displayName();
}
/**
* Set the displayName property: The display name.
*
* @param displayName the displayName value to set.
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withDisplayName(String displayName) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataEntityProperties();
}
this.innerProperties().withDisplayName(displayName);
return this;
}
/**
* Get the dependsOn property: The list of keys on which this entity depends on.
*
* @return the dependsOn value.
*/
public List dependsOn() {
return this.innerProperties() == null ? null : this.innerProperties().dependsOn();
}
/**
* Set the dependsOn property: The list of keys on which this entity depends on.
*
* @param dependsOn the dependsOn value to set.
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withDependsOn(List dependsOn) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataEntityProperties();
}
this.innerProperties().withDependsOn(dependsOn);
return this;
}
/**
* Get the applicableScenarios property: The list of scenarios applicable to this metadata entity.
*
* @return the applicableScenarios value.
*/
public List applicableScenarios() {
return this.innerProperties() == null ? null : this.innerProperties().applicableScenarios();
}
/**
* Set the applicableScenarios property: The list of scenarios applicable to this metadata entity.
*
* @param applicableScenarios the applicableScenarios value to set.
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withApplicableScenarios(List applicableScenarios) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataEntityProperties();
}
this.innerProperties().withApplicableScenarios(applicableScenarios);
return this;
}
/**
* Get the supportedValues property: The list of supported values.
*
* @return the supportedValues value.
*/
public List supportedValues() {
return this.innerProperties() == null ? null : this.innerProperties().supportedValues();
}
/**
* Set the supportedValues property: The list of supported values.
*
* @param supportedValues the supportedValues value to set.
* @return the MetadataEntityInner object itself.
*/
public MetadataEntityInner withSupportedValues(List supportedValues) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataEntityProperties();
}
this.innerProperties().withSupportedValues(supportedValues);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("id", this.id);
jsonWriter.writeStringField("type", this.type);
jsonWriter.writeStringField("name", this.name);
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MetadataEntityInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MetadataEntityInner 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 MetadataEntityInner.
*/
public static MetadataEntityInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MetadataEntityInner deserializedMetadataEntityInner = new MetadataEntityInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedMetadataEntityInner.id = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedMetadataEntityInner.type = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedMetadataEntityInner.name = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedMetadataEntityInner.innerProperties = MetadataEntityProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedMetadataEntityInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy