public class EnumerationSpecification extends Object implements UaDataTypeSpecification
| Modifier and Type | Class and Description |
|---|---|
static class |
EnumerationSpecification.Builder
Builder for
EnumerationSpecification. |
static interface |
EnumerationSpecification.EnumerationBuilderSupplier
Helper supplier interface.
|
UaNamespaceTranslateable.Context| Modifier and Type | Method and Description |
|---|---|
static EnumerationSpecification.Builder |
builder() |
DynamicEnumeration |
createEnumerationFromInteger(int value)
Deprecated.
this method works only for non-code-generated Enumerations, use
getByValue(Integer) instead. |
DynamicEnumeration |
createEnumerationFromString(String value)
Deprecated.
this method works only for non-code-generated Enumerations, use
getByName(String) instead. |
boolean |
equals(Object obj) |
SortedSet<Enumeration> |
getAllEnumValues()
Returns all Enumeration values, order is based on
Enumeration.getValue(). |
Set<Integer> |
getAllIntegerValues()
Returns all values of the Enumeration as integers.
|
Set<String> |
getAllStringValues()
Returns all values of the Enumeration as Strings.
|
Enumeration |
getByName(String enumName)
Returns the
Enumeration of this specification that matches the given name or null if
there is no match. |
Enumeration |
getByValue(Integer enumValue)
Returns the
Enumeration of this specification that matches the given value or null if
there is no match. |
LocalizedText |
getDescriptionByValue(Integer enumValue)
Returns description of the
Enumeration value, if one is available. |
Map<Integer,String> |
getIntToStringMappings()
Returns a map for Enumeration integer value to String mapping.
|
Class<? extends Enumeration> |
getJavaClass()
Returns the java
Class of the enumeration instances. |
String |
getName()
Returns the name of the Enumeration.
|
Map<String,Integer> |
getStringToIntMappings()
Returns a map for Enumeration String value to int mapping.
|
UaNodeId |
getTypeId()
Returns the DataType node NodeId that defines the
Enumeration. |
String |
getXmlName()
Internal.
|
int |
hashCode() |
boolean |
isAbstract()
Returns true if the type is known to be abstract, false otherwise.
|
EnumerationSpecification.Builder |
toBuilder()
Returns a Builder with data of this instance pre-set.
|
DataTypeDefinition |
toDataTypeDefinition(NamespaceTable namespaceTable)
Returns data of this
UaDataTypeSpecification as a DataTypeDefinition. |
Enumeration.Builder |
toEnumerationBuilder()
Creates a
Enumeration.Builder implementation that creates Enumerations that
match this specification. |
String |
toString() |
EnumerationSpecification |
withTranslatedNamespaces(UaNamespaceTranslateable.Context context)
Returns a deep copy of itself where all where every namespace index and uri plus server index
and uri (see
ExpandedNodeId, UaExpandedNodeId) has been swapped based on the
given UaNamespaceTranslateable.Context. |
public static EnumerationSpecification.Builder builder()
@Deprecated public DynamicEnumeration createEnumerationFromInteger(int value)
getByValue(Integer) instead.DynamicEnumeration based on the given value in the context of this
Enumeration.value - the Enumeration value as integerDynamicEnumeration that has the given value and matching String representation
of the value.IllegalArgumentException - if this enumeration specification does not have mapping
defined for the given value, i.e. the given value is not part of the valid values for
this Enumeration.@Deprecated public DynamicEnumeration createEnumerationFromString(String value)
getByName(String) instead.DynamicEnumeration based on the given value in the context of this
Enumeration.value - the Enumeration value as StringDynamicEnumeration that has the given value and matching Integer representation
of the value.IllegalArgumentException - if this enumeration specification does not have mapping
defined for the given value, i.e. the given value is not part of the valid values for
this Enumeration.public SortedSet<Enumeration> getAllEnumValues()
Enumeration.getValue(). The returned
set is unmodifiable.public Set<Integer> getAllIntegerValues()
public Set<String> getAllStringValues()
public Enumeration getByName(String enumName)
Enumeration of this specification that matches the given name or null if
there is no match. Returns null if given null.public Enumeration getByValue(Integer enumValue)
Enumeration of this specification that matches the given value or null if
there is no match. Returns null if given null.public LocalizedText getDescriptionByValue(Integer enumValue)
Enumeration value, if one is available. Returns
LocalizedText.EMPTY if given null or there is no description.public Map<Integer,String> getIntToStringMappings()
public Class<? extends Enumeration> getJavaClass()
Class of the enumeration instances. This is either a generated class
via Codegen or DynamicEnumeration.getJavaClass in interface UaDataTypeSpecificationpublic String getName()
getName in interface UaDataTypeSpecificationpublic Map<String,Integer> getStringToIntMappings()
public UaNodeId getTypeId()
Enumeration.getTypeId in interface UaDataTypeSpecificationpublic String getXmlName()
UaDataTypeSpecificationUaDataTypeSpecification.getName() if more context is available, such as symbolic names in NodeSet documents.
Returns same as UaDataTypeSpecification.getName() if there no such context.getXmlName in interface UaDataTypeSpecificationpublic boolean isAbstract()
UaDataTypeSpecificationUaDataTypeSpecification has been formed outside of client-server
communication or a NodeSet, it might not be possible to determine this information, in which
case this method returns false.isAbstract in interface UaDataTypeSpecificationpublic EnumerationSpecification.Builder toBuilder()
public DataTypeDefinition toDataTypeDefinition(NamespaceTable namespaceTable)
UaDataTypeSpecificationUaDataTypeSpecification as a DataTypeDefinition. This
method is mostly intended for SDK's internal use for the DataTypeDefinition Attribute's value
for UaDataType nodes, but may be useful in some complicated aggregation servers.
Note that not all UaDataTypeSpecifications can be converted to a
DataTypeDefinition (such as SimpleTypeSpecification), in which case this method
returns null. Enumeration and OptionSet-types (including 'OptionSet'-Structure subtypes, but
not the base 'OptionSet' Structure type) use EnumDefinition. Structures use
StructureDefinition.toDataTypeDefinition in interface UaDataTypeSpecificationnamespaceTable - a NamespaceTable.DataTypeDefinition based of the data of this StructureSpecification or
null in the case of SimpleTypeSpecification.public Enumeration.Builder toEnumerationBuilder()
Enumeration.Builder implementation that creates Enumerations that
match this specification. By default returns DynamicEnumeration.Builder unless more
specific supplier was given in the Builder of this EnumerationSpecification.public EnumerationSpecification withTranslatedNamespaces(UaNamespaceTranslateable.Context context)
UaNamespaceTranslateableExpandedNodeId, UaExpandedNodeId) has been swapped based on the
given UaNamespaceTranslateable.Context. Returning the same object is allowed if the type is immutable and the
result is equal to this. Note that for Structure types if the
UaDataTypeSpecification translation is active the returned type can be of different
java class.withTranslatedNamespaces in interface UaNamespaceTranslateable<UaDataTypeSpecification>Copyright © 2026. All rights reserved.