public class SortDirective extends java.lang.Object implements SortingConstants
A structure representing a single sorting directive in a SortDirectives object. Contains the name of the property to sort by, and the sorting direction, ascending (default) or descending.
SortDirectives
Modifier and Type | Field and Description |
---|---|
static boolean |
CASE_INSENSITIVE
Value used to indicate case insensitive sort
|
static boolean |
CASE_SENSITIVE
Value used to indicate case sensitive sort
|
static java.lang.String |
CLASS_VERSION
Class version string
|
static int |
DEFAULT_DIR
Default direction value
|
static int |
DIR_ASCENDING
Value used to indicate the ascending sort direction
|
static int |
DIR_DESCENDING
Value used to indicate the descending sort direction
|
ASCENDING_ATTRIBUTE_VALUE, CASE_INSENSITIVE_ATTRIBUTE_VALUE, CASE_SENSITIVE_ATTRIBUTE_VALUE, DESCENDING_ATTRIBUTE_VALUE, DIR_ATTRIBUTE_NAME, SORTBY_TAG, SORTBYVALUE_TAG, VALUE_ATTRIBUTE_NAME
Constructor and Description |
---|
SortDirective()
Constructs a new SortDirective.
|
SortDirective(java.lang.String pSortProperty)
Constructs a new SortDirective with the specified property to
sort by.
|
SortDirective(java.lang.String pSortProperty,
int pSortDirection)
Constructs a new SortDirective with the specified property to
sort by and sort direction, which should be one of DIR_ASCENDING
or DIR_DESCENDING.
|
SortDirective(java.lang.String pSortProperty,
int pSortDirection,
boolean pSortCaseSensitive)
Constructs a new SortDirective with the specified property to
sort by and sort direction and sort case sensitivity.
|
Modifier and Type | Method and Description |
---|---|
SortDirective |
copy()
Return a deep copy of this object.
|
boolean |
equals(java.lang.Object obj)
Returns true if the given SortDirective has the same property and
sort direction as this one, and false otherwise.
|
QueryExpression |
getPropertyExpression()
Get property
propertyExpression |
int |
getSortDirection()
Returns the sort direction.
|
java.lang.String |
getSortProperty()
Returns the name of the property to sort by.
|
int |
hashCode()
Get an integer hash code for this object
|
boolean |
isSortCaseSensitive()
Returns true if the sort is case sensitive.
|
void |
setPropertyExpression(QueryExpression pPropertyExpression)
Set property
propertyExpression |
void |
setSortCaseSensitive(boolean pSortCaseSensitive)
Sets whether the sort is case sensitive or not.
|
void |
setSortDirection(int pSortDirection)
Sets the sort direction.
|
void |
setSortProperty(java.lang.String pSortProperty)
Sets the name of the property to sort by.
|
java.lang.String |
toString()
Returns the string representation of the object.
|
java.lang.String |
toString(java.lang.String pIndent)
Returns the string representation of the object.
|
public static java.lang.String CLASS_VERSION
public static final int DIR_ASCENDING
public static final int DIR_DESCENDING
public static final int DEFAULT_DIR
public static final boolean CASE_SENSITIVE
public static final boolean CASE_INSENSITIVE
public SortDirective()
public SortDirective(java.lang.String pSortProperty)
property
- to sort bypublic SortDirective(java.lang.String pSortProperty, int pSortDirection)
property
- to sort bysort
- direction, DIR_ASCENDING or DIR_DESCENDING.public SortDirective(java.lang.String pSortProperty, int pSortDirection, boolean pSortCaseSensitive)
property
- to sort bysort
- direction, DIR_ASCENDING or DIR_DESCENDING.sort
- case sensitivity, true or falsepublic void setPropertyExpression(QueryExpression pPropertyExpression)
propertyExpression
pPropertyExpression
- new value to setpublic QueryExpression getPropertyExpression()
propertyExpression
propertyExpression
public SortDirective copy()
public java.lang.String getSortProperty()
public void setSortProperty(java.lang.String pSortProperty)
public int getSortDirection()
public void setSortDirection(int pSortDirection)
public boolean isSortCaseSensitive()
public void setSortCaseSensitive(boolean pSortCaseSensitive)
public java.lang.String toString(java.lang.String pIndent)
pIndent
- string to place in front of string representation
of this objectpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object