com.ibm.streams.operator.meta
Interface EnumType
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.streams.operator.Type
Type.Factory, Type.MetaType
-
-
Method Summary
Methods Modifier and Type Method and Description java.util.List<java.lang.String>
getIdentifiers()
Get the list of identifiers declared for this SPL enumeration.<E extends java.lang.Enum<E>>
voidverifyMapping(java.lang.Class<E> enumType)
Verify that the mapping between this SPL'senum
identifiers and Java enumeration typeE
is valid.<E extends java.lang.Enum<E>>
voidverifyOrdinals(java.lang.Class<E> enumType)
Verify that declared order of this SPL'senum
identifiers matches order and position of constants forE
.-
Methods inherited from interface com.ibm.streams.operator.Type
getAsCompositeElementType, getDefaultValue, getLanguageType, getMetaType, getObjectType, randomValue, toString
-
-
-
-
Method Detail
-
getIdentifiers
java.util.List<java.lang.String> getIdentifiers()
Get the list of identifiers declared for this SPL enumeration.- Returns:
- A read only list of this enumerations identifiers in declared order
-
verifyMapping
<E extends java.lang.Enum<E>> void verifyMapping(java.lang.Class<E> enumType)
Verify that the mapping between this SPL'senum
identifiers and Java enumeration typeE
is valid. Anenum
may be mapped toE
if all of its identifiers can be converted to an enumeration value using
Enum.valueOf(enumType, identifier)
E
may contain constants that do not map to thisenum
.
Verifying the mapping ensures that this SPLenum
can be safely converted to valuesE
usingTuple.getEnum(Class, int)
andOutputTuple.setEnum(Class, int, Enum)
- Type Parameters:
E
- Enumeration type to verify against this SPLenum
.- Parameters:
enumType
- Class of enumeration type to be mapped to.- Throws:
java.lang.IllegalArgumentException
- SPLenum
cannot be mapped toE
-
verifyOrdinals
<E extends java.lang.Enum<E>> void verifyOrdinals(java.lang.Class<E> enumType)
Verify that declared order of this SPL'senum
identifiers matches order and position of constants forE
.
E
may contain constants that do not map to thisenum
but such constants must have an ordinal value greater or equal to the number of identifiers.- Type Parameters:
E
- Enumeration type to verify against this SPLenum
.- Parameters:
enumType
- Class of enumeration type to be mapped to.
-
-