Package net.aifusion.metamodel
Enum DataType
- All Implemented Interfaces:
Serializable
,Comparable<DataType>
,java.lang.constant.Constable
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 ConstantDescriptionBoolean 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 TypeMethodDescriptionClass<?>[]
Return an array containing java types that are accepted as valid java types for this CIM data typeReturn the Array type corresponding to this data typeClass
<?> Return the Java class corresponding to this data typeGet the component type corresponding to this data typestatic DataType
getTypeForClass
(Class<?> javaClass) Return the CIM data type corresponding to a java classstatic DataType
Return the CIM data type corresponding to some objectgetValueFromString
(String value) Convert a string dataValue to a java object corresponding to this typeObject[]
getValuesFromStrings
(String[] values) Convert a string array to a java object containing the appropriate valuesboolean
isArray()
Check if this data type is an array typeboolean
Check if this dataType is a boolean, or array of booleansboolean
Check if this data type is a character type (or an array of character type)static boolean
Check if a java class is a valid CIM data typeboolean
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 DateTimeboolean
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 valuesboolean
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 arrayboolean
Check if this data type is an octetString, or array of octetString valuesboolean
Check if this data type is primitive, or array of primitive data typesboolean
isReal()
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) typeboolean
isString()
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 valuesboolean
Check if this data type is an unsigned integer type (or array of unsigned integer type)boolean
isVoid()
Check if this dataType is a voidboolean
Check if a java object matches this typetoMOF()
Return the MOF string for this data typestatic DataType
Returns the enum constant of this type with the specified name.static DataType[]
values()
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
-
Enum Constant Details
-
VOID
Void (null) type -
BOOLEAN
Boolean type (Boolean | boolean) -
UINT8
Unsigned 8-bit Integer (UInt8) -
UINT16
Unsigned 16-bit Integer (UInt16) -
UINT32
Unsigned 32-bit Integer (UInt32) -
UINT64
Unsigned 64-bit Integer (UInt64) -
SINT8
Signed 8-bit Integer (Byte | byte) -
SINT16
Signed 16-bit Integer (Short | short) -
SINT32
Signed 32-bit Integer (Integer | int) -
SINT64
Signed 64-bit Integer (Long | long) -
REAL32
IEEE 4-byte real number (Float | float) -
REAL64
IEEE 8-byte real number (Double | double) -
CHAR16
16-bit UCS-2 Character (Character | char) -
STRING
16-bit UCS-2 String (String) -
DATETIME
Date time (DateTime) -
OCTETSTRING
OctetString value (OctetString) -
OBJECTPATH
Object Name (ObjectPath) -
ENUMERATIONVALUE
Enumeration value (EnumerationValue) -
STRUCTUREVALUE
CimStructure value (StructureValue) -
INSTANCEVALUE
Instance value (CimInstance) -
BOOLEAN_ARRAY
Boolean array (Boolean[] | boolean[]) -
UINT8_ARRAY
Unsigned 8-bit Integer array (UInt8[]) -
UINT16_ARRAY
Unsigned 16-bit Integer array (UInt16[]) -
UINT32_ARRAY
Unsigned 32-bit Integer array (UInt32[]) -
UINT64_ARRAY
Unsigned 64-bit Integer array (UInt64[]) -
SINT8_ARRAY
Signed 8-bit Integer array (Byte[] | byte[]) -
SINT16_ARRAY
Signed 16-bit Integer array (Short[] | short[]) -
SINT32_ARRAY
Signed 32-bit Integer array (Integer[] | int[]) -
SINT64_ARRAY
Signed 64-bit Integer array (Long[] | long[]) -
REAL32_ARRAY
IEEE 4-byte real number array (Float[] | float[]) -
REAL64_ARRAY
IEEE 8-byte real number array (Double[] | double[]) -
CHAR16_ARRAY
16-bit UCS-2 Character array (Character[] | char[]) -
STRING_ARRAY
16-bit UCS-2 String array (String[]) -
DATETIME_ARRAY
Date time array (DateTime[]) -
OCTETSTRING_ARRAY
OctetString array value (OctetString[]) -
OBJECTPATH_ARRAY
Object Name array (ObjectPath[]) -
ENUMERATIONVALUE_ARRAY
Enumeration value array (EnumerationValue) -
STRUCTUREVALUE_ARRAY
CimStructure value (StructureValue) -
INSTANCEVALUE_ARRAY
Instance value (CimInstance)
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getTypeForObject
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
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
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
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
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
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
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
Return the MOF string for this data type- Returns:
- - MOF string for this data type
-
matches
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
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
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
-