public abstract class StringTextChoiceProvider extends ChoiceProvider<String>
TextChoiceProvider for Strings.| Constructor and Description |
|---|
StringTextChoiceProvider() |
| Modifier and Type | Method and Description |
|---|---|
String |
getDisplayValue(String choice)
Get the value for displaying to an end user.
|
String |
getIdValue(String choice)
This method is called to get the id value of an object (used as the value attribute of a
choice element) The id can be extracted from the object like a primary key, or if the list is
stable you could just return a toString of the index.
|
Collection<String> |
toChoices(Collection<String> ids)
Converts a list of choice ids back into application's choice objects.
|
detach, query, toJsonpublic String getDisplayValue(String choice)
ChoiceProvidergetDisplayValue in class ChoiceProvider<String>choice - the actual objectpublic String getIdValue(String choice)
ChoiceProvider
Note that the given index can be -1 if the object in question is not contained in the
available choices.
getIdValue in class ChoiceProvider<String>choice - The object for which the id should be generatedpublic Collection<String> toChoices(Collection<String> ids)
ChoiceProviderids collection will contain
exactly one id, and a collection containing exactly one choice should be returned.toChoices in class ChoiceProvider<String>ids - collection containing choice idsCopyright © 2017. All rights reserved.