PropertyBuilder
DSL builder for creating a strongly-typed Property instance.
Use this builder inside a PropertiesBuilder or a feature block to define a property with a specific type, value, optional description, fixed allowed values, and read-only status.
The builder automatically determines the correct Property subclass based on the type of value.
Example
property("max-retries") {
value = 3
description = "Maximum retry attempts"
fixedValues {
add(1)
add(3)
add(5)
}
}Content copied to clipboard
Notes
value must be set before calling build, otherwise IllegalStateException is thrown.
Supported types: All types that are implemented the Property interface internal to the library.
fixedValues duplicates are automatically removed.
readOnly marks the property as immutable after creation.
Parameters
T
Type of the property value
Properties
Functions
Link copied to clipboard
DSL helper to define fixedValues inline.