Class OrderElement


  • public class OrderElement
    extends java.lang.Object
    An element of the order by list of a PathQuery, containing a path and a direction. This class is immutable.
    Author:
    Matthew Wakeling
    • Constructor Summary

      Constructors 
      Constructor Description
      OrderElement​(java.lang.String orderPath, OrderDirection direction)
      Constructor, taking a path and a direction.
    • Constructor Detail

      • OrderElement

        public OrderElement​(java.lang.String orderPath,
                            OrderDirection direction)
        Constructor, taking a path and a direction. The path should be a normal path expression with dots separating the parts. Do not use colons to represent outer joins, and do not use square brackets to represent subclass constraints. The path will be checked for format.
        Parameters:
        orderPath - the path to order by
        direction - the direction to order in
        Throws:
        java.lang.NullPointerException - if orderPath or direction are null
        java.lang.IllegalArgumentException - if the orderPath contains colons or square brackets, or is otherwise in a bad format
    • Method Detail

      • getOrderPath

        public java.lang.String getOrderPath()
        Returns the path of this OrderElement.
        Returns:
        a String path
      • getDirection

        public OrderDirection getDirection()
        Returns the order direction of this OrderElement.
        Returns:
        an OrderDirection
      • hashCode

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object