SortCriteria Class

DEPRECATED Use com.bea.p13n.content.expression.SortCriteria instead.

com.beasys.commerce.foundation.expression
SortCriteria Class

public class SortCriteria

    extends Object

A little class which handles the sortBy part of a Search.

This object represents a single sort criteria, which is a property name and an ascending/descending flag. The class provides a utility method to parse a sortBy string into an array of SortCriteria.


Hierarchy
Object
  SortCriteria

Field Summary

public boolean
isAscending
The ascending or descending order.
public String
property
The property name to sort on.
public String
scope
The property scope name.
 

Constructor Summary

SortCriteria(String property, boolean isAscending)

Constructor.
SortCriteria(String scope, String property, boolean isAscending)

Constructor.
SortCriteria(String property)

Constructor.
 

Method Summary

public static SortCriteria[]
getSortCriteria(String sortBy)
Parse the given sort string and return an array of SortCriteria.
public String
toString()
Convert to a string.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
   

Field Detail

isAscending

public boolean isAscending
The ascending or descending order.


property

public String property
The property name to sort on.


scope

public String scope
The property scope name.

 

Constructor Detail

SortCriteria

public SortCriteria(String property, 
                    boolean isAscending)
Constructor.

SortCriteria

public SortCriteria(String scope, 
                    String property, 
                    boolean isAscending)
Constructor.

SortCriteria

public SortCriteria(String property)
Constructor.
 

Method Detail

getSortCriteria(String) Method

public static SortCriteria[] getSortCriteria(String sortBy)
throws IllegalArgumentException
Parse the given sort string and return an array of SortCriteria.

Parameters

sortBy
the sort string (e.g. "identifier ASC, creationDate DESC").

Returns

the array of SortCriteria.

Exceptions

IllegalArgumentException
thrown on an invalid sortBy string.

toString() Method

public String toString()
Convert to a string.

Overrides
Object.toString()