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 Details

    • _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 Details

    • 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 Details

    • getMetadataPath

      Get the metadataPath.
      Returns:
      the metadataPath
    • setMetadataPath

      public void setMetadataPath(String metadataPath)
      Set the metadataPath.
      Parameters:
      metadataPath - the metadataPath to set
    • 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.
    • build

      public String build()
      Build an XPath order string representing the criterion.
      Returns:
      an XPath order string.