public class Union extends DynamicStructure
Structures that have 0 or 1 of their fields set at
a time.| Modifier and Type | Class and Description |
|---|---|
static class |
Union.Builder
Base builder for Unions.
|
Structure.MapKind<T>UaNamespaceTranslateable.Context| Modifier and Type | Field and Description |
|---|---|
static StructureSpecification |
SPECIFICATION |
| Modifier | Constructor and Description |
|---|---|
|
Union() |
protected |
Union(UaDataTypeSpecification specification) |
| Modifier and Type | Method and Description |
|---|---|
Union |
clone()
Clones the Structure.
|
protected <T> T |
indexGet(int index)
Returns the field in the given index.
|
protected <T> void |
indexSet(T value,
int index)
Sets the given value to the given index.
|
Union.Builder |
toBuilder()
Returns a builder with the data of this Structure pre-set.
|
FieldSpecification |
type()
Returns currently set field.
|
Object |
value()
Returns the set value or null if no field was set.
|
builderclear, equals, forEachField, forEachField, get, get, hashCode, set, set, specification, toFieldNamesMap, toFieldNamesMap, toFieldsMap, toFieldsMap, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitreduceFields, reduceFields, toMap, withTranslatedNamespacespublic static final StructureSpecification SPECIFICATION
public Union()
protected Union(UaDataTypeSpecification specification)
public Union clone()
AbstractStructureCloneNotSupportedException
as all Structures must be cloneable.clone in interface Structureclone in class DynamicStructurepublic Union.Builder toBuilder()
Structure#getClass() as this one.toBuilder in interface StructuretoBuilder in class AbstractStructurepublic FieldSpecification type()
public Object value()
Unions only a single
field at most can be set.protected <T> T indexGet(int index)
AbstractStructureindexGet in class AbstractStructureprotected <T> void indexSet(T value,
int index)
AbstractStructureindexSet in class AbstractStructureCopyright © 2026. All rights reserved.