Class MutableSortDescriptor

java.lang.Object
net.solarnetwork.domain.MutableSortDescriptor
All Implemented Interfaces:
SortDescriptor

public class MutableSortDescriptor extends Object implements SortDescriptor
Mutable implementation of SortDescriptor. The descending property defaults to false.
Version:
1.1
Author:
matt
  • Constructor Details

    • MutableSortDescriptor

      public MutableSortDescriptor()
      Construct with ascending order.
    • MutableSortDescriptor

      public MutableSortDescriptor(String sortKey)
      Construct with a sort key. Ascending order will be used.
      Parameters:
      sortKey - the sort key
    • MutableSortDescriptor

      public MutableSortDescriptor(String sortKey, boolean descending)
      Construct with a sort key and order.
      Parameters:
      sortKey - the sort key
      descending - true to sort in descending order, false for ascending
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getSortKey

      public String getSortKey()
      Description copied from interface: SortDescriptor
      Get the name of the value to sort by.

      How this value is interpreted is implementation dependent.

      Specified by:
      getSortKey in interface SortDescriptor
      Returns:
      the sort key
    • setSortKey

      public void setSortKey(String sortKey)
      Set the sort key.
      Parameters:
      sortKey - the key to set
    • isDescending

      public boolean isDescending()
      Description copied from interface: SortDescriptor
      Return true if the sort should be in descending order, otherwise the short should be in ascending order.
      Specified by:
      isDescending in interface SortDescriptor
      Returns:
      true if the sort should be in descending order
    • setDescending

      public void setDescending(boolean descending)
      Set the descending flag.
      Parameters:
      descending - the flag to set