You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OrderBy.java 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.data.util.sqlcontainer.query;
  5. import java.io.Serializable;
  6. /**
  7. * OrderBy represents a sorting rule to be applied to a query made by the
  8. * SQLContainer's QueryDelegate.
  9. *
  10. * The sorting rule is simple and contains only the affected column's name and
  11. * the direction of the sort.
  12. */
  13. public class OrderBy implements Serializable {
  14. private String column;
  15. private boolean isAscending;
  16. /**
  17. * Prevent instantiation without required parameters.
  18. */
  19. @SuppressWarnings("unused")
  20. private OrderBy() {
  21. }
  22. public OrderBy(String column, boolean isAscending) {
  23. setColumn(column);
  24. setAscending(isAscending);
  25. }
  26. public void setColumn(String column) {
  27. this.column = column;
  28. }
  29. public String getColumn() {
  30. return column;
  31. }
  32. public void setAscending(boolean isAscending) {
  33. this.isAscending = isAscending;
  34. }
  35. public boolean isAscending() {
  36. return isAscending;
  37. }
  38. }