
com.azure.resourcemanager.automation.fluent.models.StatisticsInner 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.automation.fluent.models;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.time.OffsetDateTime;
/**
* Definition of the statistic.
*/
@Immutable
public final class StatisticsInner implements JsonSerializable {
/*
* Gets the property value of the statistic.
*/
private String counterProperty;
/*
* Gets the value of the statistic.
*/
private Long counterValue;
/*
* Gets the startTime of the statistic.
*/
private OffsetDateTime startTime;
/*
* Gets the endTime of the statistic.
*/
private OffsetDateTime endTime;
/*
* Gets the id.
*/
private String id;
/**
* Creates an instance of StatisticsInner class.
*/
public StatisticsInner() {
}
/**
* Get the counterProperty property: Gets the property value of the statistic.
*
* @return the counterProperty value.
*/
public String counterProperty() {
return this.counterProperty;
}
/**
* Get the counterValue property: Gets the value of the statistic.
*
* @return the counterValue value.
*/
public Long counterValue() {
return this.counterValue;
}
/**
* Get the startTime property: Gets the startTime of the statistic.
*
* @return the startTime value.
*/
public OffsetDateTime startTime() {
return this.startTime;
}
/**
* Get the endTime property: Gets the endTime of the statistic.
*
* @return the endTime value.
*/
public OffsetDateTime endTime() {
return this.endTime;
}
/**
* Get the id property: Gets the id.
*
* @return the id value.
*/
public String id() {
return this.id;
}
/**
* 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();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of StatisticsInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of StatisticsInner 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 StatisticsInner.
*/
public static StatisticsInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
StatisticsInner deserializedStatisticsInner = new StatisticsInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("counterProperty".equals(fieldName)) {
deserializedStatisticsInner.counterProperty = reader.getString();
} else if ("counterValue".equals(fieldName)) {
deserializedStatisticsInner.counterValue = reader.getNullable(JsonReader::getLong);
} else if ("startTime".equals(fieldName)) {
deserializedStatisticsInner.startTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("endTime".equals(fieldName)) {
deserializedStatisticsInner.endTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("id".equals(fieldName)) {
deserializedStatisticsInner.id = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedStatisticsInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy