org.wicketstuff.select2
Class Response<T>

java.lang.Object
  extended by org.wicketstuff.select2.Response<T>
Type Parameters:
T - type of choice object
All Implemented Interfaces:
Iterable<T>

public class Response<T>
extends Object
implements Iterable<T>

Response that will be sent to Select2 after it queries for matching choices.

Author:
igor

Constructor Summary
Response()
           
 
Method Summary
<Z extends T>
Response<T>
add(Z choice)
          Adds a choice to the collection
 Response<T> addAll(Collection<? extends T> choice)
          Adds choices to the collection
 Boolean getHasMore()
           
 List<T> getResults()
           
 Iterator<T> iterator()
           
 Response<T> setHasMore(Boolean more)
          Sets the more flag used to tell Select2 whether or not there are more results available.
 Response<T> setResults(List<T> results)
          Sets the results collection.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response

public Response()
Method Detail

getResults

public List<T> getResults()
Returns:
modifiable results collection

setResults

public Response<T> setResults(List<T> results)
Sets the results collection. Collection can also be incrementally built using add(Object) and addAll(Collection) methods.

Parameters:
results -
Returns:
this for chaining

getHasMore

public Boolean getHasMore()
Returns:
the mode flag used to tell Select2 whether or not there are more results available.

setHasMore

public Response<T> setHasMore(Boolean more)
Sets the more flag used to tell Select2 whether or not there are more results available.

Parameters:
more - more flag
Returns:
this for chaining

addAll

public Response<T> addAll(Collection<? extends T> choice)
Adds choices to the collection

Parameters:
choice -
Returns:
this for chaining

add

public <Z extends T> Response<T> add(Z choice)
Adds a choice to the collection

Parameters:
choice -
Returns:
this for chaining

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>

size

public int size()
Returns:
number of choices added


Copyright © 2018. All rights reserved.