org.ow2.orchestra.facade.criteria
Class Order<T>

java.lang.Object
  extended by org.ow2.orchestra.facade.criteria.Order<T>
All Implemented Interfaces:
Serializable

public class Order<T>
extends Object
implements Serializable

An Order order represent a sort on a given field. It could be either in ascending or in descending direction.

Author:
Loic Albertin
See Also:
Serialized Form

Constructor Summary
Order(SortableField<T> field, boolean ascending)
           
 
Method Summary
static
<U> Order<U>
ascending(SortableField<U> field)
          Creates an ascending order on the given sortable field
static
<U> Order<U>
descending(SortableField<U> field)
          Creates an descending order on the given sortable field
 SortableField<T> getField()
           
 boolean isAscending()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Order

public Order(SortableField<T> field,
             boolean ascending)
Parameters:
field - The field on which the sort applies
ascending - Represent the sort direction, true is ascending, false is descending.
Method Detail

getField

public final SortableField<T> getField()
Returns:
the field The field on which the sort applies

isAscending

public final boolean isAscending()
Returns:
the ascending Represent the sort direction, true is ascending, false is descending.

ascending

public static <U> Order<U> ascending(SortableField<U> field)
Creates an ascending order on the given sortable field

Parameters:
field - the field to sort
Returns:
An ascending order on the given field

descending

public static <U> Order<U> descending(SortableField<U> field)
Creates an descending order on the given sortable field

Parameters:
field - the field to sort
Returns:
An descending order on the given field


Copyright © 2011 OW2 Consortium. All Rights Reserved.