Module bus.vortex

Enum Class Channel

java.lang.Object
java.lang.Enum<Channel>
org.miaixz.bus.vortex.Channel
All Implemented Interfaces:
Serializable, Comparable<Channel>, Constable

public enum Channel extends Enum<Channel>
请求渠道枚举,定义不同的请求来源及其属性。

该枚举类用于标识请求的来源渠道(如 WEB、APP、钉钉、微信等),并为每个渠道关联一个字符串值和令牌类型。 每个枚举值通过构造函数初始化其属性,并提供静态方法 get(String) 用于根据字符串值获取对应的枚举实例。

Since:
Java 17+
Author:
Kimi Liu
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    APP 请求,表示通过移动应用程序发起的请求。
    钉钉请求,表示通过钉钉平台发起的请求。
    其他请求,表示无法归类到特定渠道的请求,作为默认回退值。
    WEB 请求,表示通过浏览器或网页发起的请求。
    微信请求,表示通过微信平台发起的请求。
  • Method Summary

    Modifier and Type
    Method
    Description
    static Channel
    get(String value)
    根据渠道值获取对应的渠道枚举实例。
    static Channel
    Returns the enum constant of this class with the specified name.
    static Channel[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • WEB

      public static final Channel WEB
      WEB 请求,表示通过浏览器或网页发起的请求。
    • APP

      public static final Channel APP
      APP 请求,表示通过移动应用程序发起的请求。
    • DINGTALK

      public static final Channel DINGTALK
      钉钉请求,表示通过钉钉平台发起的请求。
    • WECHAT

      public static final Channel WECHAT
      微信请求,表示通过微信平台发起的请求。
    • OTHER

      public static final Channel OTHER
      其他请求,表示无法归类到特定渠道的请求,作为默认回退值。
  • Method Details

    • values

      public static Channel[] 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 Channel 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
    • get

      public static Channel get(String value)
      根据渠道值获取对应的渠道枚举实例。

      该方法通过给定的字符串值查找匹配的枚举实例。如果未找到匹配的渠道,则返回 OTHER 作为默认值。

      Parameters:
      value - 渠道的字符串值
      Returns:
      匹配的 Channel 枚举实例,若无匹配则返回 OTHER