{@code
+ * sort(SortBy.property("age"), SortBy.creationTime().desc());
+ * }
+ *
+ * @param sortBy A list of sort-by clauses in the order
+ * they should be applied.
+ * @return This builder.
+ */
+ public Builder sort(SortBy... sortBy) {
+ return sort(Arrays.asList(sortBy));
+ }
+
+ /**
+ * Sort query results. Default sorted order is ascending, use
+ * {@link SortBy#desc} to reverse it.
+ *
+ * @param sortBy A list of sort-by clauses in the order
+ * they should be applied.
+ * @return This builder.
+ */
+ public Builder sort(List+ * Example: + * + *
{@code
+ * SortBy.property("name").asc();
+ * }
+ */
+ public SortBy asc() {
+ return new SortBy(path, true);
+ }
+
+ /**
+ * Sort in descending order.
+ *
+ * + * Example: + * + *
{@code
+ * SortBy.property("name").desc();
+ * }
+ */
+ public SortBy desc() {
+ return new SortBy(path, false);
+ }
+}