Package com.authlete.common.types
Enum SubjectType
- java.lang.Object
-
- java.lang.Enum<SubjectType>
-
- com.authlete.common.types.SubjectType
-
- All Implemented Interfaces:
Serializable
,Comparable<SubjectType>
public enum SubjectType extends Enum<SubjectType>
Values forsubject_type
.- Author:
- Takahiko Kawasaki
- See Also:
- OpenID Connect Core 1.0, 8. Subject Identifier Types
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SubjectType
getByValue(short value)
Find an instance of this enum by a value.short
getValue()
Get the integer representation of this enum instance.static SubjectType
parse(String subjectType)
ConvertString
toSubjectType
.static SubjectType[]
toArray(int bits)
static int
toBits(EnumSet<SubjectType> set)
static EnumSet<SubjectType>
toSet(int bits)
static EnumSet<SubjectType>
toSet(SubjectType[] array)
String
toString()
static SubjectType
valueOf(String name)
Returns the enum constant of this type with the specified name.static SubjectType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PUBLIC
public static final SubjectType PUBLIC
"public"
(1).This provides the same
sub
(subject) value to all Clients. It is the default if the provider has nosubject_types_supported
element in its discovery document.
-
PAIRWISE
public static final SubjectType PAIRWISE
"pairwise"
(2).This provides a different
sub
value to each sector identifier, so as not to enable Clients to correlate the End-User's activities without permission. See 8.1. Pairwise Identifier Algorithm for details.
-
-
Method Detail
-
values
public static SubjectType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SubjectType c : SubjectType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SubjectType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public short getValue()
Get the integer representation of this enum instance.
-
toString
public String toString()
- Overrides:
toString
in classEnum<SubjectType>
-
getByValue
public static SubjectType getByValue(short value)
Find an instance of this enum by a value.- Parameters:
value
- The integer representation of the instance to find.- Returns:
- An instance of this enum, or
null
if not found.
-
parse
public static SubjectType parse(String subjectType)
ConvertString
toSubjectType
.- Parameters:
subjectType
- A subject type. For example,"pairwise"
.- Returns:
SubjectType
instance, ornull
.
-
toBits
public static int toBits(EnumSet<SubjectType> set)
-
toArray
public static SubjectType[] toArray(int bits)
-
toSet
public static EnumSet<SubjectType> toSet(int bits)
-
toSet
public static EnumSet<SubjectType> toSet(SubjectType[] array)
-
-