Class Response<T>

java.lang.Object
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 Details

    • Response

      public Response()
  • Method Details

    • 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