Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add convenience / helper methods to KiwiSort and KiwiSort.Direction #779

Closed
sleberknight opened this issue Sep 2, 2022 · 0 comments · Fixed by #780
Closed

Add convenience / helper methods to KiwiSort and KiwiSort.Direction #779

sleberknight opened this issue Sep 2, 2022 · 0 comments · Fixed by #780
Assignees
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Milestone

Comments

@sleberknight
Copy link
Member

sleberknight commented Sep 2, 2022

Add:

  • isDescending() to both KiwiSort.Direction and KiwiSort to allow easy checking for descending direction
  • getDirectionObject() to KiwiSort; this makes it easy to obtain the Direction enum object when required, instead of having to do another conversion from a String
  • Ignore the getDirectionObject() when serializing to JSON

Originally discussed in #707

@sleberknight sleberknight added the new feature A new feature such as a new class, method, package, group of classes, etc. label Sep 2, 2022
@sleberknight sleberknight added this to the 2.3.0 milestone Sep 2, 2022
@sleberknight sleberknight self-assigned this Sep 2, 2022
sleberknight added a commit that referenced this issue Sep 2, 2022
* Add isDescending() to KiwiSort.Direction enum
* Add a Direction property named directionObject to KiwiSort to allow
  code to easily get the direction as the enum instead of a String.
  But, ignore it when serializing to JSON, since the serialized
  value is just the enum constant's name, e.g. "ASC" or "DESC", which
  it already has via the direction property
* Add isDescending() to KiwiSort

Closes #779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant