Enum Class DataUnit

java.lang.Object
java.lang.Enum<DataUnit>
com.eqixiac.equinix.design.value.savings.DataUnit
All Implemented Interfaces:
Serializable, Comparable<DataUnit>, Constable

public enum DataUnit extends Enum<DataUnit>
Unit of data volume for egress inputs. Conversions use decimal (SI) factors - 1 TB = 1000 GB - consistent with how cloud providers meter data transfer.
  • Enum Constant Details

    • GIGABYTE

      public static final DataUnit GIGABYTE
      One decimal gigabyte (the base unit).
    • TERABYTE

      public static final DataUnit TERABYTE
      One decimal terabyte = 1000 GB.
    • PETABYTE

      public static final DataUnit PETABYTE
      One decimal petabyte = 1,000,000 GB.
  • Method Details

    • values

      public static DataUnit[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DataUnit valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toGigabytes

      public BigDecimal toGigabytes(BigDecimal amount)
      Converts an amount in this unit to gigabytes.
      Parameters:
      amount - the amount in this unit; null is treated as zero
      Returns:
      the equivalent number of decimal gigabytes (ZERO for a null amount)