Skip to content

Commit 324073f

Browse files
committed
✨ additional template extensions for case munging
1 parent bef2b73 commit 324073f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/main/java/dev/ebullient/convert/qute/TtrpgTemplateExtension.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package dev.ebullient.convert.qute;
22

3-
import static dev.ebullient.convert.StringUtil.pluralize;
4-
import static dev.ebullient.convert.StringUtil.toTitleCase;
53

64
import java.util.Collection;
75

@@ -27,7 +25,19 @@ static String asBonus(Integer value) {
2725
/** Return the string capitalized. Example: `{resource.name.capitalized}` */
2826
@JavadocVerbatim
2927
static String capitalized(String s) {
30-
return toTitleCase(s);
28+
return StringUtil.toTitleCase(s);
29+
}
30+
31+
/** Return the string capitalized. Example: `{resource.name.capitalized}` */
32+
@JavadocVerbatim
33+
static String uppercaseFirst(String s) {
34+
return StringUtil.uppercaseFirst(s);
35+
}
36+
37+
/** Return the lowercase string. Example: `{resource.name.lowercase}` */
38+
@JavadocVerbatim
39+
static String lowercase(String s) {
40+
return s == null || s.isEmpty() ? s : s.toLowerCase();
3141
}
3242

3343
/**
@@ -37,7 +47,7 @@ static String capitalized(String s) {
3747
*/
3848
@JavadocVerbatim
3949
static String pluralizeLabel(Collection<?> collection, String s) {
40-
return pluralize(s, collection.size(), true);
50+
return StringUtil.pluralize(s, collection.size(), true);
4151
}
4252

4353
/**

0 commit comments

Comments
 (0)