Class CaptchaConfig.Builder

java.lang.Object
cloud.opencode.base.captcha.CaptchaConfig.Builder
Enclosing class:
CaptchaConfig

public static final class CaptchaConfig.Builder extends Object
Configuration Builder 配置构建器
Since:
JDK 25, opencode-base-captcha V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • width

      public CaptchaConfig.Builder width(int width)
      Sets the image width. 设置图像宽度。
      Parameters:
      width - the width | 宽度
      Returns:
      this builder | 此构建器
    • height

      public CaptchaConfig.Builder height(int height)
      Sets the image height. 设置图像高度。
      Parameters:
      height - the height | 高度
      Returns:
      this builder | 此构建器
    • length

      public CaptchaConfig.Builder length(int length)
      Sets the CAPTCHA code length. 设置验证码长度。
      Parameters:
      length - the length | 长度
      Returns:
      this builder | 此构建器
    • type

      public CaptchaConfig.Builder type(CaptchaType type)
      Sets the CAPTCHA type. 设置验证码类型。
      Parameters:
      type - the type | 类型
      Returns:
      this builder | 此构建器
    • expireTime

      public CaptchaConfig.Builder expireTime(Duration expireTime)
      Sets the expiration time. 设置过期时间。
      Parameters:
      expireTime - the expire time | 过期时间
      Returns:
      this builder | 此构建器
    • noiseLines

      public CaptchaConfig.Builder noiseLines(int noiseLines)
      Sets the number of noise lines. 设置干扰线数量。
      Parameters:
      noiseLines - the noise lines count | 干扰线数量
      Returns:
      this builder | 此构建器
    • noiseDots

      public CaptchaConfig.Builder noiseDots(int noiseDots)
      Sets the number of noise dots. 设置干扰点数量。
      Parameters:
      noiseDots - the noise dots count | 干扰点数量
      Returns:
      this builder | 此构建器
    • fontSize

      public CaptchaConfig.Builder fontSize(float fontSize)
      Sets the font size. 设置字体大小。
      Parameters:
      fontSize - the font size | 字体大小
      Returns:
      this builder | 此构建器
    • fontName

      public CaptchaConfig.Builder fontName(String fontName)
      Sets the font name. 设置字体名称。
      Parameters:
      fontName - the font name | 字体名称
      Returns:
      this builder | 此构建器
    • backgroundColor

      public CaptchaConfig.Builder backgroundColor(Color backgroundColor)
      Sets the background color. 设置背景颜色。
      Parameters:
      backgroundColor - the background color | 背景颜色
      Returns:
      this builder | 此构建器
    • fontColors

      public CaptchaConfig.Builder fontColors(Color... fontColors)
      Sets the font colors. 设置字体颜色。
      Parameters:
      fontColors - the font colors | 字体颜色数组
      Returns:
      this builder | 此构建器
    • caseSensitive

      public CaptchaConfig.Builder caseSensitive(boolean caseSensitive)
      Sets case sensitivity. 设置区分大小写。
      Parameters:
      caseSensitive - true for case sensitive | true 表示区分大小写
      Returns:
      this builder | 此构建器
    • gifFrameCount

      public CaptchaConfig.Builder gifFrameCount(int gifFrameCount)
      Sets the GIF frame count. 设置 GIF 帧数。
      Parameters:
      gifFrameCount - the frame count | 帧数
      Returns:
      this builder | 此构建器
    • gifDelay

      public CaptchaConfig.Builder gifDelay(int gifDelay)
      Sets the GIF frame delay. 设置 GIF 帧延迟。
      Parameters:
      gifDelay - the delay in milliseconds | 延迟(毫秒)
      Returns:
      this builder | 此构建器
    • build

      public CaptchaConfig build()
      Builds the configuration. 构建配置。
      Returns:
      the configuration | 配置