Serializable
, Cloneable
, Iterable<Prompt.Type>
, Collection<Prompt.Type>
, Set<Prompt.Type>
@NotThreadSafe public class Prompt extends LinkedHashSet<Prompt.Type>
Related specifications:
Modifier and Type | Class | Description |
---|---|---|
static class |
Prompt.Type |
Enumeration of the prompt types.
|
Constructor | 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 | Description |
---|---|---|
boolean |
isValid() |
Checks if the prompt is valid.
|
static Prompt |
parse(String s) |
Parses a prompt from the specified string.
|
static Prompt |
parse(Collection<String> collection) |
Parses a prompt from the specified string list.
|
String |
toString() |
Returns the string representation of this prompt.
|
List<String> |
toStringList() |
Returns the string list representation of this prompt.
|
addAll, containsAll, retainAll, toArray, toArray
equals, hashCode, removeAll
parallelStream, removeIf, stream
add, clear, clone, contains, isEmpty, iterator, remove, size
spliterator
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 © 2019 Connect2id Ltd.. All rights reserved.