Class Sort.Order

  • Enclosing interface:
    Sort

    public static class Sort.Order
    extends java.lang.Object
    The ordering of results.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Sort.Order.Direction
      Represents the direction of the ordering.
    • Constructor Summary

      Constructors 
      Constructor Description
      Order​(java.lang.String property)
      Constructs an order for the given property in ascending order.
      Order​(java.lang.String property, Sort.Order.Direction direction, boolean ignoreCase)
      Constructs an order for the given property with the given direction.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Sort.Order asc​(java.lang.String property)
      Creates a new order for the given property in ascending order.
      static Sort.Order asc​(java.lang.String property, boolean ignoreCase)
      Creates a new order for the given property in ascending order.
      static Sort.Order desc​(java.lang.String property)
      Creates a new order for the given property in descending order.
      static Sort.Order desc​(java.lang.String property, boolean ignoreCase)
      Creates a new order for the given property in descending order.
      boolean equals​(java.lang.Object o)  
      Sort.Order.Direction getDirection()  
      java.lang.String getProperty()  
      int hashCode()  
      boolean isAscending()  
      boolean isIgnoreCase()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Order

        public Order​(@NonNull
                     java.lang.String property)
        Constructs an order for the given property in ascending order.
        Parameters:
        property - The property
      • Order

        @Creator
        public Order​(@NonNull
                     java.lang.String property,
                     @NonNull
                     Sort.Order.Direction direction,
                     boolean ignoreCase)
        Constructs an order for the given property with the given direction.
        Parameters:
        property - The property
        direction - The direction
        ignoreCase - Whether to ignore case
    • Method Detail

      • isIgnoreCase

        public boolean isIgnoreCase()
        Returns:
        Whether to ignore case when sorting
      • getProperty

        public java.lang.String getProperty()
        Returns:
        The property name to order by
      • desc

        public static Sort.Order desc​(java.lang.String property)
        Creates a new order for the given property in descending order.
        Parameters:
        property - The property
        Returns:
        The order instance
      • asc

        public static Sort.Order asc​(java.lang.String property)
        Creates a new order for the given property in ascending order.
        Parameters:
        property - The property
        Returns:
        The order instance
      • desc

        public static Sort.Order desc​(java.lang.String property,
                                      boolean ignoreCase)
        Creates a new order for the given property in descending order.
        Parameters:
        property - The property
        ignoreCase - Whether to ignore case
        Returns:
        The order instance
      • asc

        public static Sort.Order asc​(java.lang.String property,
                                     boolean ignoreCase)
        Creates a new order for the given property in ascending order.
        Parameters:
        property - The property
        ignoreCase - Whether to ignore case
        Returns:
        The order instance
      • isAscending

        public boolean isAscending()
        Returns:
        Is the order ascending
      • equals

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

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