public final class AutocompleteSuggestion extends Object implements Serializable
AutocompleteTextFieldExtension
.
Is can contain the following informations:
value
- The actual value of the suggestiondescription
- An optional descriptionicon
- An optional icon Resource
styleNames
- An optional list of style names
Because value
contains the actual value of this suggestion, the
methods Object.hashCode()
and Object.equals(java.lang.Object)
only take
the value
property into account!
AutocompleteSuggestionProvider
,
AutocompleteTextFieldExtension
,
Serialized FormConstructor and Description |
---|
AutocompleteSuggestion(String value)
Creates a new
AutocompleteSuggestion with the given
value . |
AutocompleteSuggestion(String value,
String description)
|
AutocompleteSuggestion(String value,
String description,
com.vaadin.server.Resource icon)
|
Modifier and Type | Method and Description |
---|---|
void |
addStyleName(String styleName)
Adds one or more style names to the suggestion.
|
Object |
getData()
Gets the data of the suggestion.
|
String |
getDescription()
Gets the description.
|
com.vaadin.server.Resource |
getIcon()
Gets the icon.
|
String |
getStyleName()
Gets all user-defined CSS style names of the suggestion.
|
List<String> |
getStyleNames()
Gets the style names as unmodifiable
List . |
String |
getValue()
Gets the actual
value of the suggestion. |
void |
removeStyleName(String styleName)
Removes one or more style names from the suggestion.
|
void |
setData(Object data)
Sets the data of the suggestion.
|
void |
setDescription(String description)
Sets the description.
|
void |
setIcon(com.vaadin.server.Resource icon)
Sets the icon.
|
void |
setValue(String value)
Sets the actual value of the suggestion.
|
String |
toString() |
AutocompleteSuggestion |
withData(Object data)
Sets the data of the suggestion.
|
AutocompleteSuggestion |
withDescription(String description)
Sets the description.
|
AutocompleteSuggestion |
withIcon(com.vaadin.server.Resource icon)
Sets the icon.
|
AutocompleteSuggestion |
withStyleName(String... styleNames)
Adds one or more style names to the suggestion.
|
AutocompleteSuggestion |
withValue(String value)
Sets the actual value of the suggestion.
|
public AutocompleteSuggestion(String value) throws NullPointerException
AutocompleteSuggestion
with the given
value
.value
- The actual value
of the suggestion.NullPointerException
- If value
is null
.public AutocompleteSuggestion(String value, String description) throws NullPointerException
value
- The actual value
of the suggestion.description
- The description String
or null
.NullPointerException
- If value
is null
.public AutocompleteSuggestion(String value, String description, com.vaadin.server.Resource icon) throws NullPointerException
value
- The actual value
of the suggestion.description
- The description String
or null
.icon
- The icon Resource
or null
.NullPointerException
- If value
is null
.public Object getData()
null
.public void setData(Object data)
data
- The data of the suggestion or null
.public AutocompleteSuggestion withData(Object data)
data
- The data of the suggestion or null
.setData(java.lang.Object)
public String getValue()
value
of the suggestion.value
of the suggestion or null
.public void setValue(String value) throws NullPointerException
A null value
is not allowed!
value
- The value of the suggestion.NullPointerException
- If value
is null
.public AutocompleteSuggestion withValue(String value) throws NullPointerException
A null value
is not allowed!
value
- The value of the suggestion.NullPointerException
- If value
is null
.setValue(java.lang.String)
public String getDescription()
String
or null
.public void setDescription(String description)
description
- The description String
or null
.public AutocompleteSuggestion withDescription(String description)
description
- The description String
or null
.setDescription(java.lang.String)
public com.vaadin.server.Resource getIcon()
Resource
or null
.public void setIcon(com.vaadin.server.Resource icon)
icon
- The icon Resource
or null
.public AutocompleteSuggestion withIcon(com.vaadin.server.Resource icon)
icon
- The icon Resource
or null
.setIcon(com.vaadin.server.Resource)
public List<String> getStyleNames()
List
.List
or null
.public String getStyleName()
public void addStyleName(String styleName)
styleName
- The new style to be added to the suggestion.public AutocompleteSuggestion withStyleName(String... styleNames)
styleNames
- The new styles to be added to the suggestion.addStyleName(java.lang.String)
public void removeStyleName(String styleName)
styleName
- The style name or style names to be removed.Copyright © 2017 Max Schuster. All Rights Reserved.