Skip to content

Boolean Toggle BOOLEAN

A yes/no toggle switch. When the field type is Boolean, the type is automatically inferred — no need to explicitly specify type.

boolean

Basic Usage

java
@EruptField(
    edit = @Edit(title = "Enabled", boolType = @BoolType)
)
private Boolean enabled;

Configuration

java
public @interface BoolType {

    String trueText() default "Y";  // Text when checked

    String falseText() default "N"; // Text when unchecked

}

Examples

Custom labels with a default value:

java
@EruptField(
    edit = @Edit(title = "Gender",
                 boolType = @BoolType(trueText = "Male", falseText = "Female"))
)
private Boolean sex = true;

Contributors

The avatar of contributor named as YuePeng YuePeng
The avatar of contributor named as Claude Opus 5 (1M context) Claude Opus 5 (1M context)

Changelog

Released under the Apache-2.0 License.