Package javax.cim

Class CIMDataType

  • All Implemented Interfaces:
    java.io.Serializable

    public class CIMDataType
    extends java.lang.Object
    implements java.io.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:
    Serialized Form
    • Field Detail

      • BOOLEAN_ARRAY_T

        public static final CIMDataType BOOLEAN_ARRAY_T
        Boolean unbounded array data type
        See Also:
        Boolean
      • BOOLEAN_T

        public static final CIMDataType BOOLEAN_T
        Boolean data type
        See Also:
        Boolean
      • CHAR16

        public static final int CHAR16
        16-bit UCS-2 character
        See Also:
        Character, Constant Field Values
      • CHAR16_ARRAY_T

        public static final CIMDataType CHAR16_ARRAY_T
        16-bit UCS-2 character unbounded Array type
        See Also:
        Character
      • CHAR16_T

        public static final CIMDataType CHAR16_T
        16-bit UCS-2 character data type
        See Also:
        Character
      • CLASS_ARRAY_T

        public static final CIMDataType CLASS_ARRAY_T
        CIMClass unbounded Array type
        See Also:
        CIMClass
      • INVALID_T

        public static final CIMDataType INVALID_T
        Invalid data type
      • OBJECT_ARRAY_T

        public static final CIMDataType OBJECT_ARRAY_T
        CIMInstance unbounded Array type
        See Also:
        CIMInstance
      • OBJECT_T

        public static final CIMDataType OBJECT_T
        CIMInstance type data type (Note: For CIMV2, this can only be used when the property has either an EmbeddedInstance or EmbeddedObject qualifier)
        See Also:
        CIMInstance
      • REAL32

        public static final int REAL32
        IEEE 4-byte floating-point
        See Also:
        Float, Constant Field Values
      • REAL32_ARRAY_T

        public static final CIMDataType REAL32_ARRAY_T
        IEEE 4-byte floating-point unbounded array data type
        See Also:
        Float
      • REAL32_T

        public static final CIMDataType REAL32_T
        IEEE 4-byte floating-point data type
        See Also:
        Float
      • REAL64

        public static final int REAL64
        IEEE 8-byte floating-point
        See Also:
        Double, Constant Field Values
      • REAL64_ARRAY_T

        public static final CIMDataType REAL64_ARRAY_T
        IEEE 8-byte floating-point unbounded array data type
        See Also:
        Double
      • REAL64_T

        public static final CIMDataType REAL64_T
        IEEE 8-byte floating-point data type
        See Also:
        Double
      • SINT16_ARRAY_T

        public static final CIMDataType SINT16_ARRAY_T
        Signed 16-bit integer unbounded array data type
        See Also:
        Short
      • SINT16_T

        public static final CIMDataType SINT16_T
        Signed 16-bit integer data type
        See Also:
        Short
      • SINT32_ARRAY_T

        public static final CIMDataType SINT32_ARRAY_T
        Signed 32-bit integer unbounded array data type
        See Also:
        Integer
      • SINT32_T

        public static final CIMDataType SINT32_T
        Signed 32-bit integer data type
        See Also:
        Integer
      • SINT64_ARRAY_T

        public static final CIMDataType SINT64_ARRAY_T
        Signed 64-bit integer unbounded array data type
        See Also:
        Long
      • SINT64_T

        public static final CIMDataType SINT64_T
        Signed 64-bit integer data type
        See Also:
        Long
      • SINT8_ARRAY_T

        public static final CIMDataType SINT8_ARRAY_T
        Signed 8-bit integer unbounded array data type
        See Also:
        Byte
      • SINT8_T

        public static final CIMDataType SINT8_T
        Signed 8-bit integer data type
        See Also:
        Byte
      • STRING_ARRAY_T

        public static final CIMDataType STRING_ARRAY_T
        UCS-2 string unbounded array data type
        See Also:
        String
      • STRING_T

        public static final CIMDataType STRING_T
        UCS-2 string data type
        See Also:
        String
      • UINT16_ARRAY_T

        public static final CIMDataType UINT16_ARRAY_T
        Unsigned 16-bit integer unbounded array data type
        See Also:
        UnsignedInteger16
      • UINT32_ARRAY_T

        public static final CIMDataType UINT32_ARRAY_T
        Unsigned 32-bit integer unbounded array data type
        See Also:
        UnsignedInteger32
      • UINT64_ARRAY_T

        public static final CIMDataType UINT64_ARRAY_T
        Unsigned 64-bit integer unbounded array data type
        See Also:
        UnsignedInteger64
      • UINT8_ARRAY_T

        public static final CIMDataType UINT8_ARRAY_T
        Unsigned 8-bit integer unbounded array data type
        See Also:
        UnsignedInteger8
    • Constructor Detail

      • CIMDataType

        public CIMDataType​(int pType,
                           int pSize)
                    throws java.lang.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:
        java.lang.IllegalArgumentException - If the pSize value specified is not a positive integer.
      • CIMDataType

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

        public CIMDataType​(java.lang.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:
        java.lang.IllegalArgumentException - If the pClassName is null.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object pObj)
        Checks that the specified CIMDataType is equal to this CIMDataType.
        Overrides:
        equals in class java.lang.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​(java.lang.Object pObj)
                                             throws java.lang.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:
        java.lang.IllegalArgumentException - If pObj is not a valid CIM Type.
      • getRefClassName

        public java.lang.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 java.lang.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 java.lang.Object
        Returns:
        A string representation of this data type.