Enum Class StrTrueValidated
- All Implemented Interfaces:
com.baomidou.mybatisplus.annotation.IEnum<String>, BaseEnum<String>, Serializable, Comparable<StrTrueValidated>, Constable
字符串形式的布尔值枚举,用于表示真/假状态.
该枚举定义了多种表示“真”和“假”的字符串形式,包括:
TRUE和FALSEY和N1和0
这些常量可用于在不同系统或模块之间统一布尔值的字符串表示.
- Author:
- Liu,Dongdong
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean判断给定的字符串是否代表“真”.static StrTrueValidatedReturns the enum constant of this class with the specified name.static StrTrueValidated[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface BaseEnum
getDescription, isDefaultMethods inherited from interface com.baomidou.mybatisplus.annotation.IEnum
getValue
-
Enum Constant Details
-
STR_TRUE
-
STR_FALSE
-
STR_SYMBOL_Y
-
STR_SYMBOL_N
-
STR_ONE
-
STR_ZERO
-
-
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
-
isTrue
判断给定的字符串是否代表“真”.此方法会忽略大小写进行比较,并认为以下值为“真”:
"TRUE","1","Y"(不区分大小写).- Parameters:
value- 待判断的字符串,可以为null- Returns:
- 如果字符串代表“真”,则返回
true;否则返回false
-