Enum Class YesNo

java.lang.Object
java.lang.Enum<YesNo>
com.power4j.fist.data.constant.YesNo
All Implemented Interfaces:
Serializable, Comparable<YesNo>, Constable

public enum YesNo extends Enum<YesNo>
Since:
1.0
Author:
CJ (power4j@outlook.com)
  • Enum Constant Details

    • Y

      public static final YesNo Y
      Yes
    • N

      public static final YesNo N
      No
  • Method Details

    • values

      public static YesNo[] 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 YesNo 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
    • getValue

      public String getValue()
    • yes

      public static boolean yes(String str)
    • not

      public static boolean not(String str)
    • parseOrDefault

      public static Enabled parseOrDefault(String value, Enabled defValue)
      解析
      Parameters:
      value - 被解析的数据,可以是null
      defValue - 默认值
      Returns:
      如果解析失败返回默认值
    • parseOrNull

      public static Enabled parseOrNull(String value)
      解析
      Parameters:
      value - 被解析的数据
      Returns:
      如果解析失败返回 null
    • parseOrThrow

      public static Enabled parseOrThrow(String value, Function<String,RuntimeException> thrower)
      解析
      Parameters:
      value - 被解析的数据
      thrower - 异常抛出器
      Returns:
      如果解析失败抛出异常
    • parse

      public static Enabled parse(String value) throws IllegalArgumentException
      解析
      Parameters:
      value - 被解析的数据
      Returns:
      如果解析失败抛出 IllegalArgumentException
      Throws:
      IllegalArgumentException