Skip to content

Commit

Permalink
adds new static method to sort
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviojava committed Mar 18, 2019
1 parent aa25b43 commit 0c953b4
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,31 @@ private Sort(String name, SortType type) {
}

/**
* Creates a bew Sort instance to be used in a NoSQL query.
* Creates a wew Sort instance to be used in a NoSQL query.
*
* @param name - the field name be used in a sort process
* @param type - the way to be sorted
* @return a sort instance
* @throws NullPointerException when there are null parameters
*/
public static Sort of(String name, SortType type) {
return new Sort(name, type);
}

/**
* Creates a new Sort of the type {@link SortType.#ASC}
* @param name the field name be used in a sort process
* @return a sort instance
* @throws NullPointerException when name is null
*/
public static Sort asc(String name) {
return new Sort(name, SortType.ASC);
}

public static Sort desc(String name) {
return new Sort(name, SortType.DESC);
}

public String getName() {
return name;
}
Expand Down

0 comments on commit 0c953b4

Please sign in to comment.