Enum DataType

java.lang.Object
java.lang.Enum<DataType>
net.aifusion.metamodel.DataType
All Implemented Interfaces:
Serializable, Comparable<DataType>, java.lang.constant.Constable

public enum DataType extends Enum<DataType>
This enum contains all known CIM data types, as well as commonly used methods for manipulating them
Author:
Sharad Singhal
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Boolean type (Boolean | boolean)
    Boolean array (Boolean[] | boolean[])
    16-bit UCS-2 Character (Character | char)
    16-bit UCS-2 Character array (Character[] | char[])
    Date time (DateTime)
    Date time array (DateTime[])
    Enumeration value (EnumerationValue)
    Enumeration value array (EnumerationValue)
    Instance value (CimInstance)
    Instance value (CimInstance)
    Object Name (ObjectPath)
    Object Name array (ObjectPath[])
    OctetString value (OctetString)
    OctetString array value (OctetString[])
    IEEE 4-byte real number (Float | float)
    IEEE 4-byte real number array (Float[] | float[])
    IEEE 8-byte real number (Double | double)
    IEEE 8-byte real number array (Double[] | double[])
    Signed 16-bit Integer (Short | short)
    Signed 16-bit Integer array (Short[] | short[])
    Signed 32-bit Integer (Integer | int)
    Signed 32-bit Integer array (Integer[] | int[])
    Signed 64-bit Integer (Long | long)
    Signed 64-bit Integer array (Long[] | long[])
    Signed 8-bit Integer (Byte | byte)
    Signed 8-bit Integer array (Byte[] | byte[])
    16-bit UCS-2 String (String)
    16-bit UCS-2 String array (String[])
    CimStructure value (StructureValue)
    CimStructure value (StructureValue)
    Unsigned 16-bit Integer (UInt16)
    Unsigned 16-bit Integer array (UInt16[])
    Unsigned 32-bit Integer (UInt32)
    Unsigned 32-bit Integer array (UInt32[])
    Unsigned 64-bit Integer (UInt64)
    Unsigned 64-bit Integer array (UInt64[])
    Unsigned 8-bit Integer (UInt8)
    Unsigned 8-bit Integer array (UInt8[])
    Void (null) type
  • Method Summary

    Modifier and Type
    Method
    Description
    Class<?>[]
    Return an array containing java types that are accepted as valid java types for this CIM data type
    Return the Array type corresponding to this data type
    Return the Java class corresponding to this data type
    Get the component type corresponding to this data type
    static DataType
    getTypeForClass(Class<?> javaClass)
    Return the CIM data type corresponding to a java class
    static DataType
    Return the CIM data type corresponding to some object
    Convert a string dataValue to a java object corresponding to this type
    Convert a string array to a java object containing the appropriate values
    boolean
    Check if this data type is an array type
    boolean
    Check if this dataType is a boolean, or array of booleans
    boolean
    Check if this data type is a character type (or an array of character type)
    static boolean
    isCimType(Class<?> javaClass)
    Check if a java class is a valid CIM data type
    boolean
    Check if this data type is a complex value type (Instance, StructureValue, EnumerationValue or their arrays)
    boolean
    Check if this dataType is a DateTime, or array of DateTime
    boolean
    Check if this data type is an Enumeration type (EnumerationValue or its array)
    boolean
    Check if this data type is an instance value, or array of instance values
    boolean
    Check if this data type is an integer type (or array of integer type)
    boolean
    Check if this type is a number (real or integer) type or a number array
    boolean
    Check if this data type is an octetString, or array of octetString values
    boolean
    Check if this data type is primitive, or array of primitive data types
    boolean
    Check if this data type is a real type (or array of real type)
    boolean
    Check if this data type is a reference (or array of reference) type
    boolean
    Check if this data type is a string type (or an array of string type)
    boolean
    Check if this data type is a structure value, or an array of structure values
    boolean
    Check if this data type is an unsigned integer type (or array of unsigned integer type)
    boolean
    Check if this dataType is a void
    boolean
    Check if a java object matches this type
    Return the MOF string for this data type
    static DataType
    Returns the enum constant of this type with the specified name.
    static DataType[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • VOID

      public static final DataType VOID
      Void (null) type
    • BOOLEAN

      public static final DataType BOOLEAN
      Boolean type (Boolean | boolean)
    • UINT8

      public static final DataType UINT8
      Unsigned 8-bit Integer (UInt8)
    • UINT16

      public static final DataType UINT16
      Unsigned 16-bit Integer (UInt16)
    • UINT32

      public static final DataType UINT32
      Unsigned 32-bit Integer (UInt32)
    • UINT64

      public static final DataType UINT64
      Unsigned 64-bit Integer (UInt64)
    • SINT8

      public static final DataType SINT8
      Signed 8-bit Integer (Byte | byte)
    • SINT16

      public static final DataType SINT16
      Signed 16-bit Integer (Short | short)
    • SINT32

      public static final DataType SINT32
      Signed 32-bit Integer (Integer | int)
    • SINT64

      public static final DataType SINT64
      Signed 64-bit Integer (Long | long)
    • REAL32

      public static final DataType REAL32
      IEEE 4-byte real number (Float | float)
    • REAL64

      public static final DataType REAL64
      IEEE 8-byte real number (Double | double)
    • CHAR16

      public static final DataType CHAR16
      16-bit UCS-2 Character (Character | char)
    • STRING

      public static final DataType STRING
      16-bit UCS-2 String (String)
    • DATETIME

      public static final DataType DATETIME
      Date time (DateTime)
    • OCTETSTRING

      public static final DataType OCTETSTRING
      OctetString value (OctetString)
    • OBJECTPATH

      public static final DataType OBJECTPATH
      Object Name (ObjectPath)
    • ENUMERATIONVALUE

      public static final DataType ENUMERATIONVALUE
      Enumeration value (EnumerationValue)
    • STRUCTUREVALUE

      public static final DataType STRUCTUREVALUE
      CimStructure value (StructureValue)
    • INSTANCEVALUE

      public static final DataType INSTANCEVALUE
      Instance value (CimInstance)
    • BOOLEAN_ARRAY

      public static final DataType BOOLEAN_ARRAY
      Boolean array (Boolean[] | boolean[])
    • UINT8_ARRAY

      public static final DataType UINT8_ARRAY
      Unsigned 8-bit Integer array (UInt8[])
    • UINT16_ARRAY

      public static final DataType UINT16_ARRAY
      Unsigned 16-bit Integer array (UInt16[])
    • UINT32_ARRAY

      public static final DataType UINT32_ARRAY
      Unsigned 32-bit Integer array (UInt32[])
    • UINT64_ARRAY

      public static final DataType UINT64_ARRAY
      Unsigned 64-bit Integer array (UInt64[])
    • SINT8_ARRAY

      public static final DataType SINT8_ARRAY
      Signed 8-bit Integer array (Byte[] | byte[])
    • SINT16_ARRAY

      public static final DataType SINT16_ARRAY
      Signed 16-bit Integer array (Short[] | short[])
    • SINT32_ARRAY

      public static final DataType SINT32_ARRAY
      Signed 32-bit Integer array (Integer[] | int[])
    • SINT64_ARRAY

      public static final DataType SINT64_ARRAY
      Signed 64-bit Integer array (Long[] | long[])
    • REAL32_ARRAY

      public static final DataType REAL32_ARRAY
      IEEE 4-byte real number array (Float[] | float[])
    • REAL64_ARRAY

      public static final DataType REAL64_ARRAY
      IEEE 8-byte real number array (Double[] | double[])
    • CHAR16_ARRAY

      public static final DataType CHAR16_ARRAY
      16-bit UCS-2 Character array (Character[] | char[])
    • STRING_ARRAY

      public static final DataType STRING_ARRAY
      16-bit UCS-2 String array (String[])
    • DATETIME_ARRAY

      public static final DataType DATETIME_ARRAY
      Date time array (DateTime[])
    • OCTETSTRING_ARRAY

      public static final DataType OCTETSTRING_ARRAY
      OctetString array value (OctetString[])
    • OBJECTPATH_ARRAY

      public static final DataType OBJECTPATH_ARRAY
      Object Name array (ObjectPath[])
    • ENUMERATIONVALUE_ARRAY

      public static final DataType ENUMERATIONVALUE_ARRAY
      Enumeration value array (EnumerationValue)
    • STRUCTUREVALUE_ARRAY

      public static final DataType STRUCTUREVALUE_ARRAY
      CimStructure value (StructureValue)
    • INSTANCEVALUE_ARRAY

      public static final DataType INSTANCEVALUE_ARRAY
      Instance value (CimInstance)
  • Method Details

    • values

      public static DataType[] 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 DataType 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
    • getTypeForObject

      public static DataType getTypeForObject(Object o)
      Return the CIM data type corresponding to some object
      Parameters:
      o - - object for which the CIM data type is required
      Returns:
      - DataType for the class.
      Throws:
      ModelException - if the object does not correspond to a valid CIM data type
    • getTypeForClass

      public static DataType getTypeForClass(Class<?> javaClass)
      Return the CIM data type corresponding to a java class
      Parameters:
      javaClass - - java class for which the data type is needed (non null)
      Returns:
      - CIM data type for the class
      Throws:
      ModelException - if the java class does not correspond to a valid CIM data type
    • isCimType

      public static boolean isCimType(Class<?> javaClass)
      Check if a java class is a valid CIM data type
      Parameters:
      javaClass - - java class to test
      Returns:
      - true if the java class is exported, or has a corresponding CIM data type
    • getClassForType

      public Class<?> getClassForType()
      Return the Java class corresponding to this data type
      Returns:
      - Java class representing the data type. Note that primitive types are NOT returned, e.g., this method returns a Long.class, not long.class for SINT64 data type
    • getAcceptedClasses

      public Class<?>[] getAcceptedClasses()
      Return an array containing java types that are accepted as valid java types for this CIM data type
      Returns:
      - array containing java classes accepted as valid types for this CIM type
    • getArrayType

      public DataType getArrayType()
      Return the Array type corresponding to this data type
      Returns:
      - this type if it is already an array type, else array type corresponding this type
    • getComponentType

      public DataType getComponentType()
      Get the component type corresponding to this data type
      Returns:
      - this type if it is already a component type, else the corresponding component type
    • toMOF

      public String toMOF()
      Return the MOF string for this data type
      Returns:
      - MOF string for this data type
    • matches

      public boolean matches(Object o)
      Check if a java object matches this type
      Parameters:
      o - - java object to compare against this type
      Returns:
      - true if the java object is of this type, false otherwise
    • getValueFromString

      public Object getValueFromString(String value)
      Convert a string dataValue to a java object corresponding to this type
      Parameters:
      value - - string containing dataValue appropriate to this type
      Returns:
      - java object containing the given dataValue corresponding to this type
    • getValuesFromStrings

      public Object[] getValuesFromStrings(String[] values)
      Convert a string array to a java object containing the appropriate values
      Parameters:
      values - - string array containing the desired values
      Returns:
      - java array of this array type containing the desired values
    • isArray

      public boolean isArray()
      Check if this data type is an array type
      Returns:
      - true if this type is an array, false otherwise
    • isCharacter

      public boolean isCharacter()
      Check if this data type is a character type (or an array of character type)
      Returns:
      - true if this data type is character type, false otherwise
    • isString

      public boolean isString()
      Check if this data type is a string type (or an array of string type)
      Returns:
      - true if this data type is a string type, false otherwise
    • isInteger

      public boolean isInteger()
      Check if this data type is an integer type (or array of integer type)
      Returns:
      - true if this data type is integer, false otherwise
    • isUnsigned

      public boolean isUnsigned()
      Check if this data type is an unsigned integer type (or array of unsigned integer type)
      Returns:
      - true if this data type is an unsigned integer
    • isReal

      public boolean isReal()
      Check if this data type is a real type (or array of real type)
      Returns:
      - true if the data type is real, false otherwise
    • isReference

      public boolean isReference()
      Check if this data type is a reference (or array of reference) type
      Returns:
      - true if this data type is a reference type, false otherwise
    • isNumeric

      public boolean isNumeric()
      Check if this type is a number (real or integer) type or a number array
      Returns:
      - true if the type is numeric, false otherwise
    • isPrimitive

      public boolean isPrimitive()
      Check if this data type is primitive, or array of primitive data types
      Returns:
      - true if the data type is primitive, false otherwise
    • isComplex

      public boolean isComplex()
      Check if this data type is a complex value type (Instance, StructureValue, EnumerationValue or their arrays)
      Returns:
      - true if this data type is a complex value type
    • isEnumerationValue

      public boolean isEnumerationValue()
      Check if this data type is an Enumeration type (EnumerationValue or its array)
      Returns:
      - true if this data type is an enumeration type
    • isStructureValue

      public boolean isStructureValue()
      Check if this data type is a structure value, or an array of structure values
      Returns:
      - true if this datatype is a structure value, false otherwise
    • isInstanceValue

      public boolean isInstanceValue()
      Check if this data type is an instance value, or array of instance values
      Returns:
      - true if this data type is an instance value, false otherwise
    • isOctetString

      public boolean isOctetString()
      Check if this data type is an octetString, or array of octetString values
      Returns:
      - true if this data type is an octetString, or array of octetStrings, false otherwise
    • isBoolean

      public boolean isBoolean()
      Check if this dataType is a boolean, or array of booleans
      Returns:
      - true if the data type is a boolean, or arry of boolean values
    • isVoid

      public boolean isVoid()
      Check if this dataType is a void
      Returns:
      - true if the data type is void, false otherwise
    • isDateTime

      public boolean isDateTime()
      Check if this dataType is a DateTime, or array of DateTime
      Returns:
      - true if this data type is a dateTime value