Class OrderImpl

  • All Implemented Interfaces:
    Order

    public class OrderImpl
    extends Object
    implements Order
    PropertyPath implements the pairing of an Direction and a property. It is used to provide input for Sorting. See Spring Data Commons, but more flat design and independent of Spring libraries.
    • Method Detail

      • setDirection

        public void setDirection​(Direction direction)
      • setIgnoreCase

        public void setIgnoreCase​(boolean ignoreCase)
      • setNullHandling

        public void setNullHandling​(NullHandling nullHandling)
      • setProperty

        public void setProperty​(String property)
      • getDirection

        public Direction getDirection()
        Returns the order the property shall be sorted for.
        Specified by:
        getDirection in interface Order
        Returns:
        the order the property shall be sorted for
      • getNullHandling

        public NullHandling getNullHandling()
        Returns the used NullHandling hint, which can but may not be respected by the used datastore.
        Specified by:
        getNullHandling in interface Order
        Returns:
        the used NullHandling hint, which can but may not be respected by the used datastore.
      • getProperty

        public String getProperty()
        Returns the property to order for.
        Specified by:
        getProperty in interface Order
        Returns:
        the property to order for
      • hashCode

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

        public Order ignoreCase()
        Returns a new Order with case insensitive sorting enabled.
        Specified by:
        ignoreCase in interface Order
        Returns:
        a new Order with case insensitive sorting enabled
      • isAscending

        public boolean isAscending()
        Returns whether sorting for this property shall be ascending.
        Specified by:
        isAscending in interface Order
        Returns:
        whether sorting for this property shall be ascending
      • isDescending

        public boolean isDescending()
        Returns whether sorting for this property shall be descending.
        Specified by:
        isDescending in interface Order
        Returns:
        whether sorting for this property shall be descending
      • isIgnoreCase

        public boolean isIgnoreCase()
        Returns whether or not the sort will be case sensitive.
        Specified by:
        isIgnoreCase in interface Order
        Returns:
        whether or not the sort will be case sensitive
      • with

        public Order with​(Direction direction)
        Returns a new Order with the given Direction.
        Specified by:
        with in interface Order
        Parameters:
        direction - given direction
        Returns:
        a new Order with the given Direction
      • with

        public Order with​(NullHandling nullHandling)
        Returns a Order with the given NullHandling.
        Specified by:
        with in interface Order
        Parameters:
        nullHandling - can be null.
        Returns:
        an Order with the given NullHandling
      • withProperties

        public Sorting withProperties​(String... properties)
        Returns a new Sorting instance for the given properties.
        Specified by:
        withProperties in interface Order
        Parameters:
        properties - given properties
        Returns:
        a new SortingImpl for the given properties
      • withProperty

        public Order withProperty​(String property)
        Returns a new Order
        Specified by:
        withProperty in interface Order
        Parameters:
        property - must not be null or empty.
        Returns:
        a new Order