API reference
API reference
Select your platform
No SDKs available
No versions available

SortCriteriaBuilder Class

Modifiers: final
Builder class for creating sort criteria. All sort criteria are created using the "by" function.
This builder provides an API for defining multiple sort criteria that can be combined to create complex sorting logic. Example:
val entities = Query.where{ has(TestComponent.id) }
                    .sort {
                      with {
                        by(TestComponent.intVarData).desc()
                       }
                     }.eval()

Signature

class SortCriteriaBuilder

Constructors

SortCriteriaBuilder ()
Signature
constructor()

Functions

build ()
Signature
fun build(): List<SortCriterion>
Returns
List
by ( intData )
Create a sorting criterion for a given int attribute data.
Signature
fun by(intData: IntAttributeData): IntSortCriterion
Parameters
  The int attribute data to sort by.
Returns
  An IntSortCriterion instance that can be further configured with sort options. Example:
with { by(TestComponent.intVarData) } // Sort by integer values in ascending order

by ( longData )
Create a sorting criterion for a given long attribute data.
Signature
fun by(longData: LongAttributeData): LongSortCriterion
Parameters
  The long attribute data to sort by.
Returns
  A LongSortCriterion instance that can be further configured with sort options. Example:
with { by(TestComponent.longVarData).desc() } // Sort by long values in descending order

by ( floatData )
Create a sorting criterion for a given float attribute data.
Signature
fun by(floatData: FloatAttributeData): FloatSortCriterion
Parameters
floatData: FloatAttributeData
  The float attribute data to sort by.
Returns
  A FloatSortCriterion instance that can be further configured with sort options. Example:
with { by(TestComponent.floatVarData) } // Sort by float values in ascending order

by ( stringData )
Create a sorting criterion for a given string attribute data.
Signature
fun by(stringData: StringAttributeData): StringSortCriterion
Parameters
stringData: StringAttributeData
  The string attribute data to sort by.
Returns
  A StringSortCriterion instance that can be further configured with sort options, including case sensitivity options. Example:
with { by(TestComponent.stringVarData).descCaseInsensitive() } // Sort strings in
descending order, ignoring case

by ( vec2Data )
Create a sorting criterion for a given vector2 attribute data.
Signature
fun by(vec2Data: Vector2AttributeData): Vector2SortCriterion
Parameters
  The vector2 attribute data to sort by.
Returns
  A Vector2SortCriterion instance that can be further configured to sort by specific components (X or Y) and sort direction. Example:
with { by(TestComponent.vector2VarData).byX() } // Sort by X component in ascending order
with { by(TestComponent.vector2VarData).byY().desc() } // Sort by Y component in descending order

by ( vec3Data )
Create a sorting criterion for a given vector3 attribute data.
Signature
fun by(vec3Data: Vector3AttributeData): Vector3SortCriterion
Parameters
  The vector3 attribute data to sort by.
Returns
  A Vector3SortCriterion instance that can be further configured to sort by specific components (X, Y, or Z) and sort direction. Example:
with { by(TestComponent.vector3VarData).byX() } // Sort by X component in ascending order
with { by(TestComponent.vector3VarData).byY().desc() } // Sort by Y component in descending order
with { by(TestComponent.vector3VarData).byZ() } // Sort by Z component in ascending order

by ( vec4Data )
Create a sorting criterion for a given vector4 attribute data.
Signature
fun by(vec4Data: Vector4AttributeData): Vector4SortCriterion
Parameters
  The vector4 attribute data to sort by.
Returns
  A Vector4SortCriterion instance that can be further configured to sort by specific components (X, Y, Z, or W) and sort direction. Example:
with { by(TestComponent.vector4VarData).byX().desc() } // Sort by X component in descending order
with { by(TestComponent.vector4VarData).byY() } // Sort by Y component in ascending order
with { by(TestComponent.vector4VarData).byZ().desc() } // Sort by Z component in descending order
with { by(TestComponent.vector4VarData).byW() } // Sort by W component in ascending order

by ( poseData )
Create a sorting criterion for a given pose attribute data.
Signature
fun by(poseData: PoseAttributeData): PoseSortCriterion
Parameters
  The pose attribute data to sort by.
Returns
  A PoseSortCriterion instance that can be further configured to sort by specific position components (X, Y, Z) or orientation components (W, X, Y, Z) and sort direction. Example:
with { by(TestComponent.poseVarData).byPositionX().desc() } // Sort by position X in descending order
with { by(TestComponent.poseVarData).byPositionY() } // Sort by position Y in ascending order
with { by(TestComponent.poseVarData).byOrientationW().desc() } // Sort by orientation W in descending order

by ( timeData )
Create a sorting criterion for a given time attribute data.
Signature
fun by(timeData: TimeAttributeData): TimeSortCriterion
Parameters
  The time attribute data to sort by.
Returns
  A TimeSortCriterion instance that can be further configured with sort options. Example:
with { by(TestComponent.timeVarData).desc() } // Sort by time values in descending order