Class Sort.SortBuilder

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    Sort

    public static class Sort.SortBuilder
    extends java.lang.Object
    implements java.io.Serializable
    SortBuilder is a helper class with fluent API for constructing sort order lists. When the sort order is ready to be passed on, calling build() will create the list of sort orders
    See Also:
    Sort, Sort.asc(String), Sort.desc(String), build(), Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SortBuilder()
      Constructs an empty SortBuilder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Sort.SortBuilder append​(java.lang.String by, com.vaadin.shared.data.sort.SortDirection direction)
      Appends sorting with given sort direction.
      java.util.List<QuerySortOrder> build()
      Returns an unmodifiable list of the current sort order in this sort builder.
      Sort.SortBuilder thenAsc​(java.lang.String by)
      Appends sorting with ascending sort direction.
      Sort.SortBuilder thenDesc​(java.lang.String by)
      Appends sorting with descending sort direction.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SortBuilder

        protected SortBuilder()
        Constructs an empty SortBuilder.
    • Method Detail

      • thenAsc

        public Sort.SortBuilder thenAsc​(java.lang.String by)
        Appends sorting with ascending sort direction.
        Parameters:
        by - the object to sort by
        Returns:
        this sort builder
      • thenDesc

        public Sort.SortBuilder thenDesc​(java.lang.String by)
        Appends sorting with descending sort direction.
        Parameters:
        by - the object to sort by
        Returns:
        this sort builder
      • append

        protected Sort.SortBuilder append​(java.lang.String by,
                                          com.vaadin.shared.data.sort.SortDirection direction)
        Appends sorting with given sort direction.
        Parameters:
        by - the object to sort by
        direction - the sort direction
        Returns:
        this sort builder
      • build

        public java.util.List<QuerySortOrder> build()
        Returns an unmodifiable list of the current sort order in this sort builder.
        Returns:
        the unmodifiable sort order list