Skip to content

Commit

Permalink
feat: add getDefaultPluralFor method
Browse files Browse the repository at this point in the history
Fixes #6313
  • Loading branch information
metacosm committed Aug 29, 2024
1 parent 81b1fea commit cc8e17d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Fix #6008: removing the optional dependency on bouncy castle
* Fix #6230: introduced Quantity.multiply(int) to allow for Quantity multiplication by an integer
* Fix #6281: use GitHub binary repo for Kube API Tests
* Fix #6313: Add HasMetadata.getDefaultPluralFor method

#### Dependency Upgrade
* Fix #6052: Removed dependency on no longer maintained com.github.mifmif:generex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ static String getPlural(Class<?> clazz) {
: Pluralize.toPlural(getSingular(clazz)));
}

/**
* Retrieves the default plural form associated with the specified kind.
*
* @param kind the kind which default plural form we want to retrieve
* @return the default plural form associated with the specified kind
*/
static String getDefaultPluralFor(String kind) {
return kind != null ? Pluralize.toPlural(kind.toLowerCase(Locale.ROOT)) : null;
}

/**
* Retrieves the singular form associated with the specified class as defined by the
* {@link Singular} annotation or computes a default value (lower-cased version of the value
Expand Down

0 comments on commit cc8e17d

Please sign in to comment.