org.synyx.hades.domain
Class Sort

java.lang.Object
  extended by org.synyx.hades.domain.Sort
All Implemented Interfaces:
java.lang.Iterable<Sort.Property>

public class Sort
extends java.lang.Object
implements java.lang.Iterable<Sort.Property>

Sort option for queries. You have to provide at least a list of properties to sort for that must not include null or empty strings. The order defaults to .

Author:
Oliver Gierke

Nested Class Summary
static class Sort.Property
          Property implements the pairing of an Order and a property.
 
Field Summary
static Order DEFAULT_ORDER
           
 
Constructor Summary
Sort(java.util.List<Sort.Property> properties)
          Creates a new Sort instance.
Sort(Order order, java.lang.String... properties)
          Creates a new Sort instance.
Sort(java.lang.String... properties)
          Creates a new Sort instance.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 java.util.Iterator<Sort.Property> iterator()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ORDER

public static final Order DEFAULT_ORDER
Constructor Detail

Sort

public Sort(java.util.List<Sort.Property> properties)
Creates a new Sort instance. Takes a List of Sort.Property

Parameters:
properties - must not be null or contain null or empty strings

Sort

public Sort(java.lang.String... properties)
Creates a new Sort instance. Order defaults to .

Parameters:
properties - must not be null or contain null or empty strings

Sort

public Sort(Order order,
            java.lang.String... properties)
Creates a new Sort instance.

Parameters:
order - defaults to (for null cases, too)
properties - must not be null or contain null or empty strings
Method Detail

iterator

public java.util.Iterator<Sort.Property> iterator()
Specified by:
iterator in interface java.lang.Iterable<Sort.Property>

equals

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

hashCode

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


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