Class SortField

java.lang.Object
com.liferay.portal.odata.sort.SortField
All Implemented Interfaces:
Serializable

public class SortField extends Object implements Serializable
Models a sort field.
See Also:
  • Constructor Details

    • SortField

      public SortField(boolean asc, EntityField entityField, List<EntityField> parentEntityFields)
    • SortField

      public SortField(EntityField entityField, boolean asc)
      Creates a new sort field.
      Parameters:
      entityField - the entity field
      asc - whether the sort should be ascending
    • SortField

      public SortField(String fieldName, boolean asc)
      Creates a new sort field not linked to a entityField
      Parameters:
      fieldName - the entity field name
      asc - whether the sort should be ascending
  • Method Details

    • getSortableFieldName

      public String getSortableFieldName(Locale locale)
      Returns the field's name.
      Parameters:
      locale - the locale
      Returns:
      the field's name
    • getSortableFieldPath

      public String getSortableFieldPath(Locale locale)
    • isAscending

      public boolean isAscending()
      Returns true if the sort field is ascending.
      Returns:
      true if the sort field is ascending; false otherwise