44
55import java .util .Objects ;
66
7+ /**
8+ * The QueryOrderByElement class encodes an Order By Statement.
9+ */
710public class QueryOrderByElement {
811 private final QueryColumn queryColumn ;
912 private final boolean desc ;
@@ -18,28 +21,37 @@ public class QueryOrderByElement {
1821 this .desc = desc ;
1922 }
2023
24+ /**
25+ * Retrieves the QueryColumn of the statement which encodes the column name.
26+ *
27+ * @return The encoding QueryColumn object.
28+ */
2129 public QueryColumn getQueryColumn () {
2230 return queryColumn ;
2331 }
2432
33+ /**
34+ * Retrieves the information if this column is ordered ascendingly or descendingly.
35+ *
36+ * @return false if ascending, true if descending.
37+ */
2538 public boolean isDesc () {
2639 return desc ;
2740 }
2841
42+ /**
43+ * Compares the encoded column name.
44+ *
45+ * @param o An object to compare to.
46+ * @return True if the object is a QueryOrderByElement with a QueryColumn with generates the same identifier.
47+ */
2948 public boolean hasEqualColumn (Object o ) {
3049 if (this == o ) return true ;
3150 if (o == null || getClass () != o .getClass ()) return false ;
3251 QueryOrderByElement that = (QueryOrderByElement ) o ;
3352 return getQueryColumn ().equals (that .getQueryColumn ());
3453 }
3554
36- public boolean hasEqualOrderDirection (Object o ) {
37- if (this == o ) return true ;
38- if (o == null || getClass () != o .getClass ()) return false ;
39- QueryOrderByElement that = (QueryOrderByElement ) o ;
40- return isDesc () == that .isDesc ();
41- }
42-
4355 @ Override
4456 public boolean equals (Object o ) {
4557 if (this == o ) return true ;
0 commit comments