java.lang.Object
java.lang.Enum<BaseUnit>
org.metricshub.ipmi.core.coding.commands.fru.BaseUnit
All Implemented Interfaces:
Serializable, Comparable<BaseUnit>

public enum BaseUnit extends Enum<BaseUnit>
Represents unit which is used to access FRU
  • Enum Constant Details

    • Bytes

      public static final BaseUnit Bytes
      The device is accessed by bytes.
    • Words

      public static final BaseUnit Words
      The device is accessed by 16-bit words: Read FRU Data takes its offset in words.
  • Method Details

    • values

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

      public static BaseUnit valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Returns the code of the unit.
      Returns:
      the access type bit of Get FRU Inventory Area Info: 0 for bytes, 1 for words
    • parseInt

      public static BaseUnit parseInt(int value)
      Returns the unit of an access type bit.
      Parameters:
      value - the access type bit of Get FRU Inventory Area Info
      Returns:
      the matching unit
      Throws:
      IllegalArgumentException - when the value is neither 0 nor 1
    • getSize

      public int getSize()
      Returns the size of the unit in bytes.
      Returns:
      1 for Bytes, 2 for Words