public static class OptionSet.Builder extends DynamicStructure.Builder implements UaOptionSet.Builder, OptionSetStructure.Builder
| Modifier | Constructor and Description |
|---|---|
protected |
Builder(UaDataTypeSpecification specification,
Supplier<? extends Structure> emptyInstanceSupplier) |
| Modifier and Type | Method and Description |
|---|---|
OptionSet.Builder |
add(OptionSpecification... options)
Adds the given options (if they are part of
UaOptionSet.Builder.specification()). |
OptionSet.Builder |
addAll(Iterable<? extends OptionSpecification> options)
Adds the given options (if they are part of
UaOptionSet.Builder.specification()). |
OptionSet |
build()
Builds a Structure with the given data.
|
OptionSet.Builder |
clear()
Sets all fields to their default values (i.e.
|
boolean |
contains(OptionSpecification... options)
Returns true if the given options are set in the builder, false otherwise.
|
boolean |
containsAll(Iterable<? extends OptionSpecification> options)
Returns true if the given options are set in the builder, false otherwise.
|
ByteString |
getValidBits() |
ByteString |
getValue() |
boolean |
isValid(int bitPosition)
Returns true if the bit position is set in the
OptionSet.getValidBits(). |
boolean |
isValid(OptionSpecification option)
Returns true if the option exist (is part of
OptionSetStructure.Builder.specification()) and it's position is
set in the OptionSet.getValidBits(). |
OptionSet.Builder |
remove(OptionSpecification... options)
Removes the given options (if they are part of
UaOptionSet.Builder.specification()). |
OptionSet.Builder |
removeAll(Iterable<? extends OptionSpecification> options)
Removes the given options (if they are part of
UaOptionSet.Builder.specification()). |
OptionSet.Builder |
set(FieldSpecification field,
Object value)
Sets a new value for a field.
|
OptionSet.Builder |
setValid(int bitPosition,
boolean valid)
Sets or clears the bit in
OptionSet.getValidBits() in the position. |
OptionSet.Builder |
setValid(OptionSpecification option,
boolean valid)
Sets or clears the bit in
OptionSet.getValidBits() in the position. |
OptionSet.Builder |
setValidBits(ByteString validBits) |
OptionSet.Builder |
setValue(ByteString value) |
OptionSetStructureSpecification |
specification()
Returns the specification of the Structures that this builder builds.
|
equals, get, get, hashCode, indexGet, indexSet, set, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitget, get, setprotected Builder(UaDataTypeSpecification specification, Supplier<? extends Structure> emptyInstanceSupplier)
public OptionSet.Builder add(OptionSpecification... options)
UaOptionSet.BuilderUaOptionSet.Builder.specification()). For OptionSet
Structures, this also sets the respective OptionSet.getValidBits() bits as set.add in interface UaOptionSet.Builderpublic OptionSet.Builder addAll(Iterable<? extends OptionSpecification> options)
UaOptionSet.BuilderUaOptionSet.Builder.specification()). For OptionSet
Structures, this also sets the respective OptionSet.getValidBits() bits as set.addAll in interface UaOptionSet.Builderpublic OptionSet build()
Structure.Builderbuild in interface Structure.Builderbuild in interface OptionSetStructure.Builderbuild in interface UaOptionSet.Builderbuild in class DynamicStructure.Builderpublic OptionSet.Builder clear()
Structure.BuilderStructure.Builder shall the same as a newly created instance where no fields have been set.clear in interface Structure.Builderclear in interface OptionSetStructure.Builderclear in interface UaOptionSet.Builderclear in class AbstractStructure.Builderpublic boolean contains(OptionSpecification... options)
UaOptionSet.Buildercontains in interface UaOptionSet.Builderpublic boolean containsAll(Iterable<? extends OptionSpecification> options)
UaOptionSet.BuildercontainsAll in interface UaOptionSet.Builderpublic ByteString getValidBits()
public ByteString getValue()
public final boolean isValid(int bitPosition)
OptionSetStructure.BuilderOptionSet.getValidBits().isValid in interface OptionSetStructure.Builderpublic final boolean isValid(OptionSpecification option)
OptionSetStructure.BuilderOptionSetStructure.Builder.specification()) and it's position is
set in the OptionSet.getValidBits().isValid in interface OptionSetStructure.Builderpublic OptionSet.Builder remove(OptionSpecification... options)
UaOptionSet.BuilderUaOptionSet.Builder.specification()). For
OptionSet Structures, this also sets the respective OptionSet.getValidBits()
bits as set.remove in interface UaOptionSet.Builderpublic OptionSet.Builder removeAll(Iterable<? extends OptionSpecification> options)
UaOptionSet.BuilderUaOptionSet.Builder.specification()). For
OptionSet Structures, this also sets the respective OptionSet.getValidBits()
bits as set.removeAll in interface UaOptionSet.Builderpublic OptionSet.Builder set(FieldSpecification field, Object value)
Structure.BuilderStructure.specification(). Setting an Optional Field to null will make it
not present for encoding. Setting a Field in an Union will unset other fields.set in interface Structure.Builderset in class AbstractStructure.Builderfield - specification of a field, must be one of the fields in the specification given
by Structure.specification().value - the value of the field (can be null) * @throws IllegalArgumentException if the
given field is not one of the fields of the Structure.Builder.specification().public OptionSet.Builder setValid(int bitPosition, boolean valid)
OptionSetStructure.BuilderOptionSet.getValidBits() in the position. Does nothing if
the given position is not one of the OptionSetStructure.Builder.specification() option(s) position.setValid in interface OptionSetStructure.Builderpublic OptionSet.Builder setValid(OptionSpecification option, boolean valid)
OptionSetStructure.BuilderOptionSet.getValidBits() in the position. Does nothing if
the given option is not part of OptionSetStructure.Builder.specification().setValid in interface OptionSetStructure.Builderpublic OptionSet.Builder setValidBits(ByteString validBits)
public OptionSet.Builder setValue(ByteString value)
public OptionSetStructureSpecification specification()
Structure.Builderspecification in interface Structure.Builderspecification in interface OptionSetStructure.Builderspecification in interface UaOptionSet.Builderspecification in class AbstractStructure.BuilderCopyright © 2026. All rights reserved.