com.azure.resourcemanager.storagecache.models.StorageTargetSpaceAllocation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-storagecache Show documentation
Show all versions of azure-resourcemanager-storagecache Show documentation
This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Managed Lustre provides a fully managed Lustre® file system, integrated with Blob storage, for use on demand. These operations create and manage Azure Managed Lustre file systems. Package tag package-2024-03.
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.resourcemanager.storagecache.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;
/**
* Storage Target space allocation properties.
*/
@Fluent
public final class StorageTargetSpaceAllocation implements JsonSerializable {
/*
* Name of the storage target.
*/
private String name;
/*
* The percentage of cache space allocated for this storage target
*/
private Integer allocationPercentage;
/**
* Creates an instance of StorageTargetSpaceAllocation class.
*/
public StorageTargetSpaceAllocation() {
}
/**
* Get the name property: Name of the storage target.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: Name of the storage target.
*
* @param name the name value to set.
* @return the StorageTargetSpaceAllocation object itself.
*/
public StorageTargetSpaceAllocation withName(String name) {
this.name = name;
return this;
}
/**
* Get the allocationPercentage property: The percentage of cache space allocated for this storage target.
*
* @return the allocationPercentage value.
*/
public Integer allocationPercentage() {
return this.allocationPercentage;
}
/**
* Set the allocationPercentage property: The percentage of cache space allocated for this storage target.
*
* @param allocationPercentage the allocationPercentage value to set.
* @return the StorageTargetSpaceAllocation object itself.
*/
public StorageTargetSpaceAllocation withAllocationPercentage(Integer allocationPercentage) {
this.allocationPercentage = allocationPercentage;
return this;
}
/**
* 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();
jsonWriter.writeStringField("name", this.name);
jsonWriter.writeNumberField("allocationPercentage", this.allocationPercentage);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of StorageTargetSpaceAllocation from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of StorageTargetSpaceAllocation 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 StorageTargetSpaceAllocation.
*/
public static StorageTargetSpaceAllocation fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
StorageTargetSpaceAllocation deserializedStorageTargetSpaceAllocation = new StorageTargetSpaceAllocation();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedStorageTargetSpaceAllocation.name = reader.getString();
} else if ("allocationPercentage".equals(fieldName)) {
deserializedStorageTargetSpaceAllocation.allocationPercentage
= reader.getNullable(JsonReader::getInt);
} else {
reader.skipChildren();
}
}
return deserializedStorageTargetSpaceAllocation;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy