@NotThreadSafe public class Prompt extends LinkedHashSet<Prompt.Type>
Related specifications:
Modifier and Type | Class and Description |
---|---|
static class |
Prompt.Type
Enumeration of the prompt types.
|
Constructor and Description |
---|
Prompt()
Creates a new empty prompt.
|
Prompt(Prompt.Type... type)
Creates a new prompt with the specified types.
|
Prompt(String... values)
Creates a new prompt with the specified type values.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isValid()
Checks if the prompt is valid.
|
static Prompt |
parse(Collection<String> collection)
Parses a prompt from the specified string list.
|
static Prompt |
parse(String s)
Parses a prompt from the specified string.
|
String |
toString()
Returns the string representation of this prompt.
|
List<String> |
toStringList()
Returns the string list representation of this prompt.
|
add, clear, clone, contains, isEmpty, iterator, remove, size
equals, hashCode, removeAll
addAll, containsAll, retainAll, toArray, toArray
public Prompt()
public Prompt(Prompt.Type... type)
type
- The prompt types.public Prompt(String... values)
values
- The prompt type values.IllegalArgumentException
- If the type value is
invalid.public boolean isValid()
Prompt.Type.NONE
value.true
if this prompt if valid, else false
.public List<String> toStringList()
public String toString()
Example:
login consent
toString
in class AbstractCollection<Prompt.Type>
public static Prompt parse(Collection<String> collection) throws ParseException
collection
- The string list to parse, with one or more
non-conflicting prompt types. May be null
.null
if the parsed string list was
null
or empty.ParseException
- If the string list couldn't be parsed to a
valid prompt.public static Prompt parse(String s) throws ParseException
s
- The string to parse, with one or more non-conflicting space
delimited prompt types. May be null
.null
if the parsed string was
null
or empty.ParseException
- If the string couldn't be parsed to a valid
prompt.Copyright © 2016 Connect2id Ltd.. All Rights Reserved.