com.boonamber.models.MStreamingParameters Maven / Gradle / Ivy
The newest version!
/*
* Amber API Server
* Boon Logic Amber API server
*
* The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.boonamber.models;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.math.BigDecimal;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.boonamber.JSON;
/**
* MStreamingParameters
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class MStreamingParameters {
public static final String SERIALIZED_NAME_VERSION_NUMBER = "versionNumber";
@SerializedName(SERIALIZED_NAME_VERSION_NUMBER)
private BigDecimal versionNumber;
public static final String SERIALIZED_NAME_M_ENABLE_AUTOTUNING = "m_EnableAutotuning";
@SerializedName(SERIALIZED_NAME_M_ENABLE_AUTOTUNING)
private Boolean mEnableAutotuning;
public static final String SERIALIZED_NAME_M_SAMPLES_TO_BUFFER_FOR_AUTOTUNING = "m_SamplesToBufferForAutotuning";
@SerializedName(SERIALIZED_NAME_M_SAMPLES_TO_BUFFER_FOR_AUTOTUNING)
private BigDecimal mSamplesToBufferForAutotuning;
public static final String SERIALIZED_NAME_M_GRADUATION_AT_RATE_NUMERATOR = "m_GraduationAtRateNumerator";
@SerializedName(SERIALIZED_NAME_M_GRADUATION_AT_RATE_NUMERATOR)
private BigDecimal mGraduationAtRateNumerator;
public static final String SERIALIZED_NAME_M_GRADUATION_AT_RATE_DENOMINATOR = "m_GraduationAtRateDenominator";
@SerializedName(SERIALIZED_NAME_M_GRADUATION_AT_RATE_DENOMINATOR)
private BigDecimal mGraduationAtRateDenominator;
public static final String SERIALIZED_NAME_M_GRADUATE_AT_MAX_CLUSTERS = "m_GraduateAtMaxClusters";
@SerializedName(SERIALIZED_NAME_M_GRADUATE_AT_MAX_CLUSTERS)
private BigDecimal mGraduateAtMaxClusters;
public static final String SERIALIZED_NAME_M_GRADUATE_AT_MAX_SAMPLES = "m_GraduateAtMaxSamples";
@SerializedName(SERIALIZED_NAME_M_GRADUATE_AT_MAX_SAMPLES)
private BigDecimal mGraduateAtMaxSamples;
public MStreamingParameters() {
}
public MStreamingParameters versionNumber(BigDecimal versionNumber) {
this.versionNumber = versionNumber;
return this;
}
/**
* Get versionNumber
* @return versionNumber
**/
@javax.annotation.Nullable
public BigDecimal getVersionNumber() {
return versionNumber;
}
public void setVersionNumber(BigDecimal versionNumber) {
this.versionNumber = versionNumber;
}
public MStreamingParameters mEnableAutotuning(Boolean mEnableAutotuning) {
this.mEnableAutotuning = mEnableAutotuning;
return this;
}
/**
* Get mEnableAutotuning
* @return mEnableAutotuning
**/
@javax.annotation.Nullable
public Boolean getmEnableAutotuning() {
return mEnableAutotuning;
}
public void setmEnableAutotuning(Boolean mEnableAutotuning) {
this.mEnableAutotuning = mEnableAutotuning;
}
public MStreamingParameters mSamplesToBufferForAutotuning(BigDecimal mSamplesToBufferForAutotuning) {
this.mSamplesToBufferForAutotuning = mSamplesToBufferForAutotuning;
return this;
}
/**
* Get mSamplesToBufferForAutotuning
* @return mSamplesToBufferForAutotuning
**/
@javax.annotation.Nonnull
public BigDecimal getmSamplesToBufferForAutotuning() {
return mSamplesToBufferForAutotuning;
}
public void setmSamplesToBufferForAutotuning(BigDecimal mSamplesToBufferForAutotuning) {
this.mSamplesToBufferForAutotuning = mSamplesToBufferForAutotuning;
}
public MStreamingParameters mGraduationAtRateNumerator(BigDecimal mGraduationAtRateNumerator) {
this.mGraduationAtRateNumerator = mGraduationAtRateNumerator;
return this;
}
/**
* Get mGraduationAtRateNumerator
* @return mGraduationAtRateNumerator
**/
@javax.annotation.Nonnull
public BigDecimal getmGraduationAtRateNumerator() {
return mGraduationAtRateNumerator;
}
public void setmGraduationAtRateNumerator(BigDecimal mGraduationAtRateNumerator) {
this.mGraduationAtRateNumerator = mGraduationAtRateNumerator;
}
public MStreamingParameters mGraduationAtRateDenominator(BigDecimal mGraduationAtRateDenominator) {
this.mGraduationAtRateDenominator = mGraduationAtRateDenominator;
return this;
}
/**
* Get mGraduationAtRateDenominator
* @return mGraduationAtRateDenominator
**/
@javax.annotation.Nonnull
public BigDecimal getmGraduationAtRateDenominator() {
return mGraduationAtRateDenominator;
}
public void setmGraduationAtRateDenominator(BigDecimal mGraduationAtRateDenominator) {
this.mGraduationAtRateDenominator = mGraduationAtRateDenominator;
}
public MStreamingParameters mGraduateAtMaxClusters(BigDecimal mGraduateAtMaxClusters) {
this.mGraduateAtMaxClusters = mGraduateAtMaxClusters;
return this;
}
/**
* Get mGraduateAtMaxClusters
* @return mGraduateAtMaxClusters
**/
@javax.annotation.Nonnull
public BigDecimal getmGraduateAtMaxClusters() {
return mGraduateAtMaxClusters;
}
public void setmGraduateAtMaxClusters(BigDecimal mGraduateAtMaxClusters) {
this.mGraduateAtMaxClusters = mGraduateAtMaxClusters;
}
public MStreamingParameters mGraduateAtMaxSamples(BigDecimal mGraduateAtMaxSamples) {
this.mGraduateAtMaxSamples = mGraduateAtMaxSamples;
return this;
}
/**
* Get mGraduateAtMaxSamples
* @return mGraduateAtMaxSamples
**/
@javax.annotation.Nonnull
public BigDecimal getmGraduateAtMaxSamples() {
return mGraduateAtMaxSamples;
}
public void setmGraduateAtMaxSamples(BigDecimal mGraduateAtMaxSamples) {
this.mGraduateAtMaxSamples = mGraduateAtMaxSamples;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MStreamingParameters mStreamingParameters = (MStreamingParameters) o;
return Objects.equals(this.versionNumber, mStreamingParameters.versionNumber) &&
Objects.equals(this.mEnableAutotuning, mStreamingParameters.mEnableAutotuning) &&
Objects.equals(this.mSamplesToBufferForAutotuning, mStreamingParameters.mSamplesToBufferForAutotuning) &&
Objects.equals(this.mGraduationAtRateNumerator, mStreamingParameters.mGraduationAtRateNumerator) &&
Objects.equals(this.mGraduationAtRateDenominator, mStreamingParameters.mGraduationAtRateDenominator) &&
Objects.equals(this.mGraduateAtMaxClusters, mStreamingParameters.mGraduateAtMaxClusters) &&
Objects.equals(this.mGraduateAtMaxSamples, mStreamingParameters.mGraduateAtMaxSamples);
}
@Override
public int hashCode() {
return Objects.hash(versionNumber, mEnableAutotuning, mSamplesToBufferForAutotuning, mGraduationAtRateNumerator, mGraduationAtRateDenominator, mGraduateAtMaxClusters, mGraduateAtMaxSamples);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MStreamingParameters {\n");
sb.append(" versionNumber: ").append(toIndentedString(versionNumber)).append("\n");
sb.append(" mEnableAutotuning: ").append(toIndentedString(mEnableAutotuning)).append("\n");
sb.append(" mSamplesToBufferForAutotuning: ").append(toIndentedString(mSamplesToBufferForAutotuning)).append("\n");
sb.append(" mGraduationAtRateNumerator: ").append(toIndentedString(mGraduationAtRateNumerator)).append("\n");
sb.append(" mGraduationAtRateDenominator: ").append(toIndentedString(mGraduationAtRateDenominator)).append("\n");
sb.append(" mGraduateAtMaxClusters: ").append(toIndentedString(mGraduateAtMaxClusters)).append("\n");
sb.append(" mGraduateAtMaxSamples: ").append(toIndentedString(mGraduateAtMaxSamples)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet openapiFields;
public static HashSet openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
openapiFields.add("versionNumber");
openapiFields.add("m_EnableAutotuning");
openapiFields.add("m_SamplesToBufferForAutotuning");
openapiFields.add("m_GraduationAtRateNumerator");
openapiFields.add("m_GraduationAtRateDenominator");
openapiFields.add("m_GraduateAtMaxClusters");
openapiFields.add("m_GraduateAtMaxSamples");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
openapiRequiredFields.add("m_SamplesToBufferForAutotuning");
openapiRequiredFields.add("m_GraduationAtRateNumerator");
openapiRequiredFields.add("m_GraduationAtRateDenominator");
openapiRequiredFields.add("m_GraduateAtMaxClusters");
openapiRequiredFields.add("m_GraduateAtMaxSamples");
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to MStreamingParameters
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (!MStreamingParameters.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null
throw new IllegalArgumentException(String.format("The required field(s) %s in MStreamingParameters is not found in the empty JSON string", MStreamingParameters.openapiRequiredFields.toString()));
}
}
Set> entries = jsonObj.entrySet();
// check to see if the JSON string contains additional fields
for (Entry entry : entries) {
if (!MStreamingParameters.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MStreamingParameters` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : MStreamingParameters.openapiRequiredFields) {
if (jsonObj.get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!MStreamingParameters.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'MStreamingParameters' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(MStreamingParameters.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, MStreamingParameters value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public MStreamingParameters read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
return thisAdapter.fromJsonTree(jsonObj);
}
}.nullSafe();
}
}
/**
* Create an instance of MStreamingParameters given an JSON string
*
* @param jsonString JSON string
* @return An instance of MStreamingParameters
* @throws IOException if the JSON string is invalid with respect to MStreamingParameters
*/
public static MStreamingParameters fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, MStreamingParameters.class);
}
/**
* Convert an instance of MStreamingParameters to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}