Enum Class FeatureLifecycle

java.lang.Object
java.lang.Enum<FeatureLifecycle>
cloud.opencode.base.feature.lifecycle.FeatureLifecycle
All Implemented Interfaces:
Serializable, Comparable<FeatureLifecycle>, Constable

public enum FeatureLifecycle extends Enum<FeatureLifecycle>
Feature Lifecycle State 功能生命周期状态

Represents the lifecycle state of a feature toggle.

表示功能开关的生命周期状态。

Lifecycle States | 生命周期状态:

  • CREATED - Newly created, not yet active | 新创建,尚未激活
  • ACTIVE - Active and in use | 活跃且在使用中
  • DEPRECATED - Deprecated, should not be used | 已弃用,不应使用
  • ARCHIVED - Archived, no longer available | 已归档,不再可用

Usage Examples | 使用示例:

FeatureLifecycle state = FeatureLifecycle.ACTIVE;
if (state.isUsable()) {
    // Feature can be used
}

Security | 安全性:

  • Thread-safe: Yes (immutable enum) - 线程安全: 是(不可变枚举)
  • Null-safe: N/A - 空值安全: 不适用
Since:
JDK 25, opencode-base-feature V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • CREATED

      public static final FeatureLifecycle CREATED
      Newly created, not yet active 新创建,尚未激活
    • ACTIVE

      public static final FeatureLifecycle ACTIVE
      Active and in use 活跃且在使用中
    • DEPRECATED

      public static final FeatureLifecycle DEPRECATED
      Deprecated, should not be used 已弃用,不应使用
    • ARCHIVED

      public static final FeatureLifecycle ARCHIVED
      Archived, no longer available 已归档,不再可用
  • Method Details

    • values

      public static FeatureLifecycle[] 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 FeatureLifecycle 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
    • getDescription

      public String getDescription()
      Get the English description 获取英文描述
      Returns:
      description | 描述
    • getDescriptionZh

      public String getDescriptionZh()
      Get the Chinese description 获取中文描述
      Returns:
      Chinese description | 中文描述
    • isUsable

      public boolean isUsable()
      Check if this lifecycle state allows feature usage 检查此生命周期状态是否允许使用功能

      Only CREATED and ACTIVE are considered usable.

      CREATEDACTIVE 被视为可用。

      Returns:
      true if usable | 如果可用返回true