blpapi.Constant¶
- class blpapi.Constant¶
Represents the value of a schema enumeration constant.
Constants can be any of the following
DataType
s:BOOL
,CHAR
,BYTE
,INT32
,INT64
,FLOAT32
,FLOAT64
,STRING
,DATE
,TIME
,DATETIME
. This class provides access not only to to the constant value, but also to the symbolic name, the description, and the status of the constant.Constant
objects are read-only.Application clients never create
Constant
object directly; applications will typically work withConstant
objects returned by otherblpapi
components.- getValue()¶
- Returns
Value of this object as it is stored in the object.
- getValueAsDatetime()¶
- Returns
Value of this object as one of the datetime types.
- Return type
- Raises
InvalidConversionException – If the value cannot be converted to one of the datetime types.
- getValueAsFloat()¶
- Returns
Value of this object as a float.
- Return type
- Raises
InvalidConversionException – If the value cannot be converted to a float.
- getValueAsInteger()¶
- Returns
Value of this object as an integer.
- Return type
- Raises
InvalidConversionException – If the value cannot be converted to an integer.
- getValueAsString()¶
- Returns
Value of this object as a string.
- Return type
- Raises
InvalidConversionException – If the value cannot be converted to a string.
- status()¶
-
The possible return values are enumerated in
SchemaStatus
.