Class SortCriteria.SortCriterion
- java.lang.Object
-
- org.ametys.plugins.repository.query.SortCriteria.SortCriterion
-
- Enclosing class:
- SortCriteria
public class SortCriteria.SortCriterion extends Object
A sort criterion.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_ascending
True if the sort is made in ascending order, false otherwise.protected String
_jcrProperty
The JCR property.protected String
_metadataPath
The metadata path.protected boolean
_normalize
True to sort on normalized versions of the properties, false otherwise.
-
Constructor Summary
Constructors Constructor Description SortCriterion(String metadataPath, String jcrProperty, boolean ascending, boolean normalize)
Build a sort criterion.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
build()
Build an XPath order string representing the criterion.String
getJcrProperty()
Get the jcrProperty.String
getMetadataPath()
Get the metadataPath.boolean
isAscending()
Test if the results are to be sorted in ascending order.boolean
isNormalizedSort()
Test if the results are to be sorted in normalized form.void
setAscending(boolean ascending)
Set the criterion to sort in ascending order.void
setJcrProperty(String jcrProperty)
Set the jcrProperty.void
setMetadataPath(String metadataPath)
Set the metadataPath.void
setNormalize(boolean normalize)
Set the criterion to sort in normalized form.
-
-
-
Field Detail
-
_metadataPath
protected String _metadataPath
The metadata path.
-
_jcrProperty
protected String _jcrProperty
The JCR property.
-
_ascending
protected boolean _ascending
True if the sort is made in ascending order, false otherwise.
-
_normalize
protected boolean _normalize
True to sort on normalized versions of the properties, false otherwise.
-
-
Constructor Detail
-
SortCriterion
public SortCriterion(String metadataPath, String jcrProperty, boolean ascending, boolean normalize)
Build a sort criterion.- Parameters:
metadataPath
- the metadata path (can be null if a JCR property is provided).jcrProperty
- the JCR property (can be null if a metadata path is provided).ascending
- true to sort in ascending order, false otherwise.normalize
- true to sort on normalized properties, false otherwise.
-
-
Method Detail
-
getMetadataPath
public String getMetadataPath()
Get the metadataPath.- Returns:
- the metadataPath
-
setMetadataPath
public void setMetadataPath(String metadataPath)
Set the metadataPath.- Parameters:
metadataPath
- the metadataPath to set
-
getJcrProperty
public String getJcrProperty()
Get the jcrProperty.- Returns:
- the jcrProperty
-
setJcrProperty
public void setJcrProperty(String jcrProperty)
Set the jcrProperty.- Parameters:
jcrProperty
- the jcrProperty to set
-
isAscending
public boolean isAscending()
Test if the results are to be sorted in ascending order.- Returns:
- true to sort in ascending order, false otherwise.
-
setAscending
public void setAscending(boolean ascending)
Set the criterion to sort in ascending order.- Parameters:
ascending
- true to sort in ascending order, false otherwise.
-
isNormalizedSort
public boolean isNormalizedSort()
Test if the results are to be sorted in normalized form.- Returns:
- true to sort in normalized form, false otherwise.
-
setNormalize
public void setNormalize(boolean normalize)
Set the criterion to sort in normalized form.- Parameters:
normalize
- true to sort in normalized form, false otherwise.
-
-