Class ComputeResourceDefinition
java.lang.Object
com.azure.resourcemanager.hdinsight.containers.models.ComputeResourceDefinition
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ComputeResourceDefinition>
public final class ComputeResourceDefinition
extends Object
implements com.azure.json.JsonSerializable<ComputeResourceDefinition>
The cpu and memory requirement definition.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of ComputeResourceDefinition class. -
Method Summary
Modifier and TypeMethodDescriptionfloatcpu()Get the cpu property: The required CPU.static ComputeResourceDefinitionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ComputeResourceDefinition from the JsonReader.longmemory()Get the memory property: The required memory in MB, Container memory will be 110 percentile.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withCpu(float cpu) Set the cpu property: The required CPU.withMemory(long memory) Set the memory property: The required memory in MB, Container memory will be 110 percentile.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ComputeResourceDefinition
public ComputeResourceDefinition()Creates an instance of ComputeResourceDefinition class.
-
-
Method Details
-
cpu
public float cpu()Get the cpu property: The required CPU.- Returns:
- the cpu value.
-
withCpu
Set the cpu property: The required CPU.- Parameters:
cpu- the cpu value to set.- Returns:
- the ComputeResourceDefinition object itself.
-
memory
public long memory()Get the memory property: The required memory in MB, Container memory will be 110 percentile.- Returns:
- the memory value.
-
withMemory
Set the memory property: The required memory in MB, Container memory will be 110 percentile.- Parameters:
memory- the memory value to set.- Returns:
- the ComputeResourceDefinition object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ComputeResourceDefinition>- Throws:
IOException
-
fromJson
public static ComputeResourceDefinition fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ComputeResourceDefinition from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ComputeResourceDefinition 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.IOException- If an error occurs while reading the ComputeResourceDefinition.
-