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 1.0
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionPrompt()
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 TypeMethodDescriptionboolean
isValid()
Checks if the prompt is valid.static Prompt
Parses a prompt from the specified string.static Prompt
parse
(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
spliterator
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size, toArray, toArray
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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.NONE
value.- Returns:
true
if 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:
toString
in 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,
null
if the parsed string list wasnull
or 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,
null
if the parsed string wasnull
or empty. - Throws:
ParseException
- If the string couldn't be parsed to a valid prompt.
-