Enum Class StrTrueValidated

java.lang.Object
java.lang.Enum<StrTrueValidated>
com.codeupsoft.base.common.enums.StrTrueValidated
All Implemented Interfaces:
com.baomidou.mybatisplus.annotation.IEnum<String>, BaseEnum<String>, Serializable, Comparable<StrTrueValidated>, Constable

public enum StrTrueValidated extends Enum<StrTrueValidated> implements BaseEnum<String>
字符串形式的布尔值枚举,用于表示真/假状态.

该枚举定义了多种表示“真”和“假”的字符串形式,包括:

  • TRUEFALSE
  • YN
  • 10

这些常量可用于在不同系统或模块之间统一布尔值的字符串表示.

Author:
Liu,Dongdong
  • Enum Constant Details

  • Method Details

    • values

      public static StrTrueValidated[] 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

      public static StrTrueValidated valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • isTrue

      public static boolean isTrue(String value)
      判断给定的字符串是否代表“真”.

      此方法会忽略大小写进行比较,并认为以下值为“真”: "TRUE", "1", "Y"(不区分大小写).

      Parameters:
      value - 待判断的字符串,可以为 null
      Returns:
      如果字符串代表“真”,则返回 true;否则返回 false