java.lang.Object
org.wicketstuff.select2.Response<T>
- Type Parameters:
T- type of choice object
- All Implemented Interfaces:
Iterable<T>
Response that will be sent to Select2 after it queries for matching choices.
- Author:
- igor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(Z choice) Adds a choice to the collectionaddAll(Collection<? extends T> choice) Adds choices to the collectioniterator()setHasMore(Boolean more) Sets themoreflag used to tell Select2 whether or not there are more results available.setResults(List<T> results) Sets the results collection.intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Response
public Response()
-
-
Method Details
-
getResults
- Returns:
- modifiable results collection
-
setResults
Sets the results collection. Collection can also be incrementally built usingadd(Object)andaddAll(Collection)methods.- Parameters:
results-- Returns:
thisfor chaining
-
getHasMore
- Returns:
- the
modeflag used to tell Select2 whether or not there are more results available.
-
setHasMore
Sets themoreflag used to tell Select2 whether or not there are more results available.- Parameters:
more- more flag- Returns:
thisfor chaining
-
addAll
Adds choices to the collection- Parameters:
choice-- Returns:
thisfor chaining
-
add
Adds a choice to the collection- Parameters:
choice-- Returns:
thisfor chaining
-
iterator
-
size
public int size()- Returns:
- number of choices added
-