Enum Class CaptchaType
- All Implemented Interfaces:
Serializable, Comparable<CaptchaType>, Constable
Captcha Type - Enumeration of supported CAPTCHA types
验证码类型 - 支持的验证码类型枚举
This enum defines all available CAPTCHA generation types.
此枚举定义了所有可用的验证码生成类型。
Features | 主要功能:
- Text-based types: NUMERIC, ALPHA, ALPHANUMERIC, ARITHMETIC, CHINESE - 文本类型
- Animated type: GIF - 动画类型
- Interactive types: SLIDER, CLICK, ROTATE, IMAGE_SELECT, JIGSAW - 交互式类型
- Audio type: AUDIO - 音频类型
- Invisible type: POW - 无感类型
- Type classification helpers (isInteractive, isTextBased, isAudio, isInvisible) - 类型分类辅助方法
Usage Examples | 使用示例:
CaptchaType type = CaptchaType.ALPHANUMERIC;
boolean interactive = type.isInteractive(); // false
boolean textBased = type.isTextBased(); // true
Captcha captcha = OpenCaptcha.create(type);
Security | 安全性:
- Thread-safe: Yes (immutable enum) - 线程安全: 是(不可变枚举)
- Null-safe: N/A - 空值安全: 不适用
- Since:
- JDK 25, opencode-base-captcha V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAlphabetic CAPTCHA (letters only) 字母验证码(仅字母)Alphanumeric CAPTCHA (letters and digits) 字母数字验证码(字母和数字)Arithmetic CAPTCHA (math expression) 算术验证码(数学表达式)Audio CAPTCHA (audio challenge) 音频验证码(音频挑战)Chinese CAPTCHA (Chinese characters) 中文验证码(中文字符)Click CAPTCHA (click specific areas) 点击验证码(点击特定区域)GIF animated CAPTCHA GIF 动画验证码Image selection CAPTCHA (select matching images) 图片选择验证码(选择匹配的图片)Jigsaw CAPTCHA (puzzle piece ordering) 拼接验证码(碎片排序)Numeric CAPTCHA (digits only) 数字验证码(仅数字)Proof-of-Work CAPTCHA (invisible computation) 工作量证明验证码(无感计算)Rotate CAPTCHA (rotate to correct angle) 旋转验证码(旋转到正确角度)Slider CAPTCHA (drag to verify) 滑块验证码(拖动验证) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAudio()Checks if this type is an audio CAPTCHA.booleanChecks if this type is an interactive CAPTCHA.booleanChecks if this type is invisible (no user interaction).booleanChecks if this type is a text-based CAPTCHA.static CaptchaTypeReturns the enum constant of this class with the specified name.static CaptchaType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NUMERIC
Numeric CAPTCHA (digits only) 数字验证码(仅数字) -
ALPHA
Alphabetic CAPTCHA (letters only) 字母验证码(仅字母) -
ALPHANUMERIC
Alphanumeric CAPTCHA (letters and digits) 字母数字验证码(字母和数字) -
ARITHMETIC
Arithmetic CAPTCHA (math expression) 算术验证码(数学表达式) -
CHINESE
Chinese CAPTCHA (Chinese characters) 中文验证码(中文字符) -
GIF
GIF animated CAPTCHA GIF 动画验证码 -
SLIDER
Slider CAPTCHA (drag to verify) 滑块验证码(拖动验证) -
CLICK
Click CAPTCHA (click specific areas) 点击验证码(点击特定区域) -
ROTATE
Rotate CAPTCHA (rotate to correct angle) 旋转验证码(旋转到正确角度) -
IMAGE_SELECT
Image selection CAPTCHA (select matching images) 图片选择验证码(选择匹配的图片) -
AUDIO
Audio CAPTCHA (audio challenge) 音频验证码(音频挑战) -
JIGSAW
Jigsaw CAPTCHA (puzzle piece ordering) 拼接验证码(碎片排序) -
POW
Proof-of-Work CAPTCHA (invisible computation) 工作量证明验证码(无感计算)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isInteractive
public boolean isInteractive()Checks if this type is an interactive CAPTCHA. 检查此类型是否为交互式验证码。- Returns:
- true if interactive | 如果是交互式则返回 true
-
isTextBased
public boolean isTextBased()Checks if this type is a text-based CAPTCHA. 检查此类型是否为文本验证码。- Returns:
- true if text-based | 如果是文本类型则返回 true
-
isAudio
public boolean isAudio()Checks if this type is an audio CAPTCHA. 检查是否为音频验证码。- Returns:
- true if audio | 如果是音频验证码则返回 true
-
isInvisible
public boolean isInvisible()Checks if this type is invisible (no user interaction). 检查是否为无感验证码。- Returns:
- true if invisible | 如果是无感验证码则返回 true
-