Package com.nimbusds.openid.connect.sdk
Class Prompt
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Prompt.Type>,Collection<Prompt.Type>,Set<Prompt.Type>
Prompts for end-user re-authentication and consent.
Related specifications:
- OpenID Connect Core 1.0, section 3.1.2.1.
- Initiating User Registration via OpenID Connect (draft 04)
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPrompt()Creates a new empty prompt.Prompt(Prompt.Type... type) Creates a new prompt with the specified types.Creates a new prompt with the specified type values. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValid()Checks if the prompt is valid.static PromptParses a prompt from the specified string.static Promptparse(Collection<String> collection) Parses a prompt from the specified string list.toString()Returns the string representation of this prompt.Returns the string list representation of this prompt.Methods inherited from class java.util.LinkedHashSet
spliteratorMethods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size, toArray, toArrayMethods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAllMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
Prompt
public Prompt()Creates a new empty prompt. -
Prompt
Creates a new prompt with the specified types.- Parameters:
type- The prompt types.
-
Prompt
Creates a new prompt with the specified type values.- Parameters:
values- The prompt type values.- Throws:
IllegalArgumentException- If the type value is invalid.
-
-
Method Details
-
isValid
Checks if the prompt is valid. This is done by examining the prompt for a conflictingPrompt.Type.NONEvalue.- Returns:
trueif this prompt if valid, elsefalse.
-
toStringList
Returns the string list representation of this prompt.- Returns:
- The string list representation.
-
toString
Returns the string representation of this prompt. The values are delimited by space.Example:
login consent
- Overrides:
toStringin classAbstractCollection<Prompt.Type>- Returns:
- The string representation.
-
parse
Parses a prompt from the specified string list.- Parameters:
collection- The string list to parse, with one or more non-conflicting prompt types. May benull.- Returns:
- The prompt,
nullif the parsed string list wasnullor empty. - Throws:
ParseException- If the string list couldn't be parsed to a valid prompt.
-
parse
Parses a prompt from the specified string.- Parameters:
s- The string to parse, with one or more non-conflicting space delimited prompt types. May benull.- Returns:
- The prompt,
nullif the parsed string wasnullor empty. - Throws:
ParseException- If the string couldn't be parsed to a valid prompt.
-