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

    Constructors
    Constructor
    Description
    Creates an instance of ComputeResourceDefinition class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    cpu()
    Get the cpu property: The required CPU.
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of ComputeResourceDefinition from the JsonReader.
    long
    Get the memory property: The required memory in MB, Container memory will be 110 percentile.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    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, wait

    Methods 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

      public ComputeResourceDefinition withCpu(float cpu)
      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

      public ComputeResourceDefinition withMemory(long memory)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.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.