Package javax.cim

Class CIMDataType

java.lang.Object
javax.cim.CIMDataType
All Implemented Interfaces:
Serializable

public class CIMDataType extends Object implements Serializable
This class represents a CIM data type as defined by the Distributed Management Task Force (DMTF) CIM Infrastructure Specification (DSP004). The specification only allows a set number of data types. This class defines the mapping of CIM data types to Java objects.

Note: CIM allows the fixed size of an array as part of the data type. The predefined classes are unbounded.

The following table shows the mapping of CIM data type to Java.
CIM Data Type Java Representation
uint8 UnsignedInteger8
sint8 Byte
uint16 UnsignedInteger16
sint16 Short
uint32 UnsignedInteger32
sint32 Integer
uint64 UnsignedInteger64
sint64 Long
string String
boolean Boolean
real32 Float
real64 Double
datetime CIMDataTimeAbsolute
CIMDataTimeInterval
<classname> ref CIMObjectPath
char16 Character
See Also:
  • Field Details

  • Constructor Details

    • CIMDataType

      public CIMDataType(int pType, int pSize) throws IllegalArgumentException
      Constructs a CIMDataType array object of the specified type and size. This should only be used when the size is being limited/defined as part of the data type.
      Parameters:
      pType - The data type as defined in the CIM class.
      pSize - The maximum number of elements in the array.
      Throws:
      IllegalArgumentException - If the pSize value specified is not a positive integer.
    • CIMDataType

      public CIMDataType(String pClassName)
      Creates a new CIM REFERENCE data type object with the specified class reference.
      Parameters:
      pClassName - The CIM class reference name.
      Throws:
      IllegalArgumentException - If the pClassName is null.
    • CIMDataType

      public CIMDataType(String pClassName, int pSize)
      Creates a new CIM REFERENCE array data type object with the specified class reference.
      Parameters:
      pClassName - The CIM class reference name.
      pSize - The size of the array. 0 indicates the array is unbounded.
      Throws:
      IllegalArgumentException - If the pClassName is null.
  • Method Details

    • equals

      public boolean equals(Object pObj)
      Checks that the specified CIMDataType is equal to this CIMDataType.
      Overrides:
      equals in class Object
      Parameters:
      pObj - The object to compare.
      Returns:
      true if the specified object is equal to this CIMDataType; false otherwise.
    • getDataType

      public static final CIMDataType getDataType(Object pObj) throws IllegalArgumentException
      Get the data type of an object.
      Parameters:
      pObj - The object whose data type is to be returned.
      Returns:
      The data type of the specified object.
      Throws:
      IllegalArgumentException - If pObj is not a valid CIM Type.
    • getRefClassName

      public String getRefClassName()
      Returns the class name of the CIM REFERENCE data type.
      Returns:
      The CIM REFERENCE class name.
    • getSize

      public int getSize()
      Returns the size of the maximum number of elements an array data type may hold.
      Returns:
      The maximum size of the array data type.
    • getType

      public int getType()
      Returns the data type.
      Returns:
      The data type.
    • isArray

      public boolean isArray()
      Checks if the data type is an array type.
      Returns:
      true if the data type is an array type, false otherwise.
    • toString

      public String toString()
      Returns a String representation of the CIMDataType. This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations. The returned string may be empty but may not be null.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this data type.