Enum Class Oauth2GrantType

java.lang.Object
java.lang.Enum<Oauth2GrantType>
com.power4j.fist.boot.security.oauth2.Oauth2GrantType
All Implemented Interfaces:
Serializable, Comparable<Oauth2GrantType>, Constable

public enum Oauth2GrantType extends Enum<Oauth2GrantType>
授权类型 see rfc6749 section-1.3
Since:
1.0
Author:
CJ (power4j@outlook.com)
  • Enum Constant Details

    • AUTHORIZATION_CODE

      public static final Oauth2GrantType AUTHORIZATION_CODE
      AUTHORIZATION_CODE
    • IMPLICIT

      public static final Oauth2GrantType IMPLICIT
      IMPLICIT
    • REFRESH_TOKEN

      public static final Oauth2GrantType REFRESH_TOKEN
      REFRESH_TOKEN
    • CLIENT_CREDENTIALS

      public static final Oauth2GrantType CLIENT_CREDENTIALS
      CLIENT_CREDENTIALS
    • PASSWORD

      public static final Oauth2GrantType PASSWORD
      PASSWORD
  • Method Details

    • values

      public static Oauth2GrantType[] 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 Oauth2GrantType 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()
    • valueSet

      public static Set<String> valueSet()
    • parseOrDefault

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

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

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

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