Package com.atlassian.jira.search
Record Class NaturalFieldSort
java.lang.Object
java.lang.Record
com.atlassian.jira.search.NaturalFieldSort
- Record Components:
field- the name of the field to sortorder- the sort order i.e. ascending/descendingsortMissingValuesLast- if true, documents that are missing the sort field will appear last on ascending order, and mirrored (i.e. first) on descending order.If false then it will be the opposite.
- All Implemented Interfaces:
FieldSort
@PublicApi
public record NaturalFieldSort(String field, FieldSort.Order order, boolean sortMissingValuesLast)
extends Record
implements FieldSort
Default implementation of
FieldSort for natural sorting.
This replaces StringSortComparatorSource and LongSortComparatorSource.
- Since:
- 10.4
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.search.FieldSort
FieldSort.Order -
Constructor Summary
ConstructorsConstructorDescriptionNaturalFieldSort(String field, FieldSort.Order order) NaturalFieldSort(String field, FieldSort.Order order, boolean sortMissingValuesLast) Creates an instance of aNaturalFieldSortrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.field()Returns the value of thefieldrecord component.final inthashCode()Returns a hash code value for this object.order()Returns the value of theorderrecord component.reverse()booleanReturns the value of thesortMissingValuesLastrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NaturalFieldSort
-
NaturalFieldSort
Creates an instance of aNaturalFieldSortrecord class.- Parameters:
field- the value for thefieldrecord componentorder- the value for theorderrecord componentsortMissingValuesLast- the value for thesortMissingValuesLastrecord component
-
-
Method Details
-
reverse
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
field
Returns the value of thefieldrecord component. -
order
Returns the value of theorderrecord component. -
sortMissingValuesLast
public boolean sortMissingValuesLast()Returns the value of thesortMissingValuesLastrecord component.- Returns:
- the value of the
sortMissingValuesLastrecord component
-