Interface RadioButton

All Superinterfaces:
FormField

public non-sealed interface RadioButton extends FormField
Radio Button Form Field 单选按钮表单字段

Features | 主要功能:

  • Option list access - 选项列表访问
  • Single selection management - 单选管理

Usage Examples | 使用示例:

RadioButton radio = (RadioButton) form.getField("gender");
List<String> options = radio.getOptions();
radio.setSelectedOption("Male");

Security | 安全性:

  • Thread-safe: Depends on implementation - 线程安全: 取决于实现
  • Null-safe: Depends on implementation - 空值安全: 取决于实现
Since:
JDK 25, opencode-base-pdf V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • getType

      default FormField.FieldType getType()
      Description copied from interface: FormField
      Gets field type 获取字段类型
      Specified by:
      getType in interface FormField
      Returns:
      field type | 字段类型
    • getOptions

      List<String> getOptions()
      Gets available options 获取可用选项
      Returns:
      list of option values | 选项值列表
    • getSelectedOption

      String getSelectedOption()
      Gets selected option 获取选中的选项
      Returns:
      selected option value | 选中的选项值
    • setSelectedOption

      void setSelectedOption(String option)
      Sets selected option 设置选中的选项
      Parameters:
      option - option to select | 要选中的选项