All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.ai.metricsadvisor.implementation.models.DataFeedMetric Maven / Gradle / Ivy

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.ai.metricsadvisor.implementation.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 DataFeedMetric model.
 */
@Fluent
public final class DataFeedMetric implements JsonSerializable {
    /*
     * metric id
     */
    private String metricId;

    /*
     * metric name
     */
    private String metricName;

    /*
     * metric display name
     */
    private String metricDisplayName;

    /*
     * metric description
     */
    private String metricDescription;

    /**
     * Creates an instance of DataFeedMetric class.
     */
    public DataFeedMetric() {
    }

    /**
     * Get the metricId property: metric id.
     * 
     * @return the metricId value.
     */
    public String getMetricId() {
        return this.metricId;
    }

    /**
     * Get the metricName property: metric name.
     * 
     * @return the metricName value.
     */
    public String getMetricName() {
        return this.metricName;
    }

    /**
     * Set the metricName property: metric name.
     * 
     * @param metricName the metricName value to set.
     * @return the DataFeedMetric object itself.
     */
    public DataFeedMetric setMetricName(String metricName) {
        this.metricName = metricName;
        return this;
    }

    /**
     * Get the metricDisplayName property: metric display name.
     * 
     * @return the metricDisplayName value.
     */
    public String getMetricDisplayName() {
        return this.metricDisplayName;
    }

    /**
     * Set the metricDisplayName property: metric display name.
     * 
     * @param metricDisplayName the metricDisplayName value to set.
     * @return the DataFeedMetric object itself.
     */
    public DataFeedMetric setMetricDisplayName(String metricDisplayName) {
        this.metricDisplayName = metricDisplayName;
        return this;
    }

    /**
     * Get the metricDescription property: metric description.
     * 
     * @return the metricDescription value.
     */
    public String getMetricDescription() {
        return this.metricDescription;
    }

    /**
     * Set the metricDescription property: metric description.
     * 
     * @param metricDescription the metricDescription value to set.
     * @return the DataFeedMetric object itself.
     */
    public DataFeedMetric setMetricDescription(String metricDescription) {
        this.metricDescription = metricDescription;
        return this;
    }

    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("metricName", this.metricName);
        jsonWriter.writeStringField("metricDisplayName", this.metricDisplayName);
        jsonWriter.writeStringField("metricDescription", this.metricDescription);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of DataFeedMetric from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of DataFeedMetric if the JsonReader was pointing to an instance of it, or null if it was
     * pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the DataFeedMetric.
     */
    public static DataFeedMetric fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            DataFeedMetric deserializedDataFeedMetric = new DataFeedMetric();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("metricName".equals(fieldName)) {
                    deserializedDataFeedMetric.metricName = reader.getString();
                } else if ("metricId".equals(fieldName)) {
                    deserializedDataFeedMetric.metricId = reader.getString();
                } else if ("metricDisplayName".equals(fieldName)) {
                    deserializedDataFeedMetric.metricDisplayName = reader.getString();
                } else if ("metricDescription".equals(fieldName)) {
                    deserializedDataFeedMetric.metricDescription = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDataFeedMetric;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy