Enum Class Enabled

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

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

    • YES

      public static final Enabled YES
      enabled
    • NO

      public static final Enabled NO
      disabled
  • Method Details

    • values

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