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

Overload KiwiSort#of factory method with String direction #772

Closed
sleberknight opened this issue Sep 1, 2022 · 0 comments · Fixed by #773
Closed

Overload KiwiSort#of factory method with String direction #772

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

Comments

@sleberknight
Copy link
Member

Add overload of the of factory method to allow a string (which must resolve to a valid KiwiSort.Direction in a lenient fashion) to KiwiSort, e.g. of(String property, String direction).

It should throw IllegalArgumentException if the given direction does not resolve to a valid KiwiSort.Direction.

Originally proposed in #707

@sleberknight sleberknight added the new feature A new feature such as a new class, method, package, group of classes, etc. label Sep 1, 2022
@sleberknight sleberknight added this to the 2.3.0 milestone Sep 1, 2022
@sleberknight sleberknight self-assigned this Sep 1, 2022
sleberknight added a commit that referenced this issue Sep 1, 2022
Add overloads of KiwiSort#of factory method to accept direction as a
String. Also add an overload to allow caller to specify a Locale for
converting the given String value to uppercase.

Closes #772
sleberknight added a commit that referenced this issue Sep 1, 2022
Instead of converting the given String value to uppercase
and having to deal with Locales, do a case-insensitive
comparison instead. To make this much easier, I just used
EnumUtils#getEnumIgnoreCase from commons-lang3.
Now, there is no need for allowing a Locale to be supplied
which was a really an implementation detail and should not
be part of the public API.

Refs #770 #772
sleberknight added a commit that referenced this issue Sep 1, 2022
Instead of converting the given String value to uppercase
and having to deal with Locales, do a case-insensitive
comparison instead. To make this much easier, I just used
EnumUtils#getEnumIgnoreCase from commons-lang3.
Now, there is no need for allowing a Locale to be supplied
which was a really an implementation detail and should not
be part of the public API.

Refs #770 #772
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