com.azure.ai.metricsadvisor.implementation.models.SuppressCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-ai-metricsadvisor Show documentation
Show all versions of azure-ai-metricsadvisor Show documentation
This package contains the Microsoft Azure Cognitive Services Metrics Advisor SDK.
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 SuppressCondition model.
*/
@Fluent
public final class SuppressCondition implements JsonSerializable {
/*
* min point number, value range : [1, +∞)
*/
private int minNumber;
/*
* min point ratio, value range : (0, 100]
*/
private double minRatio;
/**
* Creates an instance of SuppressCondition class.
*/
public SuppressCondition() {
}
/**
* Get the minNumber property: min point number, value range : [1, +∞).
*
* @return the minNumber value.
*/
public int getMinNumber() {
return this.minNumber;
}
/**
* Set the minNumber property: min point number, value range : [1, +∞).
*
* @param minNumber the minNumber value to set.
* @return the SuppressCondition object itself.
*/
public SuppressCondition setMinNumber(int minNumber) {
this.minNumber = minNumber;
return this;
}
/**
* Get the minRatio property: min point ratio, value range : (0, 100].
*
* @return the minRatio value.
*/
public double getMinRatio() {
return this.minRatio;
}
/**
* Set the minRatio property: min point ratio, value range : (0, 100].
*
* @param minRatio the minRatio value to set.
* @return the SuppressCondition object itself.
*/
public SuppressCondition setMinRatio(double minRatio) {
this.minRatio = minRatio;
return this;
}
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeIntField("minNumber", this.minNumber);
jsonWriter.writeDoubleField("minRatio", this.minRatio);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of SuppressCondition from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SuppressCondition 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 SuppressCondition.
*/
public static SuppressCondition fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SuppressCondition deserializedSuppressCondition = new SuppressCondition();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("minNumber".equals(fieldName)) {
deserializedSuppressCondition.minNumber = reader.getInt();
} else if ("minRatio".equals(fieldName)) {
deserializedSuppressCondition.minRatio = reader.getDouble();
} else {
reader.skipChildren();
}
}
return deserializedSuppressCondition;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy