Skip to content

Commit cc8e17d

Browse files
committed
feat: add getDefaultPluralFor method
Fixes #6313
1 parent 81b1fea commit cc8e17d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Fix #6008: removing the optional dependency on bouncy castle
1010
* Fix #6230: introduced Quantity.multiply(int) to allow for Quantity multiplication by an integer
1111
* Fix #6281: use GitHub binary repo for Kube API Tests
12+
* Fix #6313: Add HasMetadata.getDefaultPluralFor method
1213

1314
#### Dependency Upgrade
1415
* Fix #6052: Removed dependency on no longer maintained com.github.mifmif:generex

kubernetes-model-generator/kubernetes-model-core/src/main/java/io/fabric8/kubernetes/api/model/HasMetadata.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ static String getPlural(Class<?> clazz) {
122122
: Pluralize.toPlural(getSingular(clazz)));
123123
}
124124

125+
/**
126+
* Retrieves the default plural form associated with the specified kind.
127+
*
128+
* @param kind the kind which default plural form we want to retrieve
129+
* @return the default plural form associated with the specified kind
130+
*/
131+
static String getDefaultPluralFor(String kind) {
132+
return kind != null ? Pluralize.toPlural(kind.toLowerCase(Locale.ROOT)) : null;
133+
}
134+
125135
/**
126136
* Retrieves the singular form associated with the specified class as defined by the
127137
* {@link Singular} annotation or computes a default value (lower-cased version of the value

0 commit comments

Comments
 (0)