org.synyx.hades.domain
Class Sort.Property

java.lang.Object
  extended by org.synyx.hades.domain.Sort.Property
Enclosing class:
Sort

public static class Sort.Property
extends java.lang.Object

Property implements the pairing of an Order and a property. It is used to provide input for Sort

Author:
Joachim Uhrlaß - ecapot@gmail.com, Oliver Gierke

Constructor Summary
Sort.Property(Order order, java.lang.String property)
          Creates a new Sort.Property instance. if order is null then order defaults to
Sort.Property(java.lang.String property)
          Creates a new Sort.Property instance.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
           
 Order getOrder()
          Returns the order the property shall be sorted for.
 int hashCode()
           
 boolean isAscending()
          Returns whether sorting for this property shall be ascending.
 Sort.Property with(Order order)
          Returns a new Sort.Property with the given Order.
 Sort withProperties(java.lang.String... properties)
          Returns a new Sort instance for the given properties.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sort.Property

public Sort.Property(Order order,
                     java.lang.String property)
Creates a new Sort.Property instance. if order is null then order defaults to

Parameters:
order - can be null
property - must not be null or empty

Sort.Property

public Sort.Property(java.lang.String property)
Creates a new Sort.Property instance. Takes a single property. Order defaults to

Parameters:
property - - must not be null or empty
Method Detail

getOrder

public Order getOrder()
Returns the order the property shall be sorted for.

Returns:

getName

public java.lang.String getName()

isAscending

public boolean isAscending()
Returns whether sorting for this property shall be ascending.

Returns:

with

public Sort.Property with(Order order)
Returns a new Sort.Property with the given Order.

Parameters:
order -
Returns:

withProperties

public Sort withProperties(java.lang.String... properties)
Returns a new Sort instance for the given properties.

Parameters:
properties -
Returns:

hashCode

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2009-2010 Synyx GmbH & Co. KG. All Rights Reserved.