Skip to content

Commit 7983440

Browse files
authored
Merge branch 'main' into docs/improve-docs
2 parents 9b5bca7 + ebcacaf commit 7983440

11 files changed

Lines changed: 101 additions & 223 deletions

File tree

.github/workflows/auto-assign.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ jobs:
1616
uses: actions/checkout@v6
1717

1818
- name: Auto Assign Reviewers for Pull Requests
19-
uses: kentaro-m/auto-assign-action@v2.0.0
19+
uses: kentaro-m/auto-assign-action@v2.0.1
2020
with:
2121
configuration-path: .github/auto_assign.yml

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'com.vanniktech.maven.publish' version '0.35.0'
3+
id 'com.vanniktech.maven.publish' version '0.36.0'
44
id 'dev.rafandoo.versioning' version '1.0.0'
55
id 'org.jetbrains.dokka' version '2.1.0'
66
}

cup-core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dependencies {
2-
implementation 'org.json:json:20250517'
2+
implementation 'org.json:json:20251224'
33
}

cup-core/src/main/java/dev/rafandoo/cup/date/DateUtils.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public final class DateUtils {
3333
/**
3434
* Formats a {@link LocalDate} using the default pattern ({@value #DEFAULT_DATE_PATTERN}).
3535
*
36-
* @param date the date to format
37-
* @return the formatted date, or {@code null} if date is null
36+
* @param date the date to format.
37+
* @return the formatted date, or {@code null} if date is null.
3838
*/
3939
public static String format(LocalDate date) {
4040
return format(date, DEFAULT_DATE_PATTERN);
@@ -43,9 +43,9 @@ public static String format(LocalDate date) {
4343
/**
4444
* Formats a {@link LocalDate} using a custom pattern.
4545
*
46-
* @param date the date to format
47-
* @param pattern the formatting pattern
48-
* @return the formatted date, or {@code null} if date is null
46+
* @param date the date to format.
47+
* @param pattern the formatting pattern.
48+
* @return the formatted date, or {@code null} if date is null.
4949
*/
5050
public static String format(LocalDate date, String pattern) {
5151
if (date == null) {
@@ -57,8 +57,8 @@ public static String format(LocalDate date, String pattern) {
5757
/**
5858
* Formats a {@link LocalDateTime} using the default pattern ({@value #DEFAULT_DATE_TIME_PATTERN}).
5959
*
60-
* @param dateTime the date-time to format
61-
* @return the formatted date-time, or {@code null} if dateTime is null
60+
* @param dateTime the date-time to format.
61+
* @return the formatted date-time, or {@code null} if dateTime is null.
6262
*/
6363
public static String format(LocalDateTime dateTime) {
6464
return format(dateTime, DEFAULT_DATE_TIME_PATTERN);
@@ -67,9 +67,9 @@ public static String format(LocalDateTime dateTime) {
6767
/**
6868
* Formats a {@link LocalDateTime} using a custom pattern.
6969
*
70-
* @param dateTime the date-time to format
71-
* @param pattern the formatting pattern
72-
* @return the formatted date-time, or {@code null} if dateTime is null
70+
* @param dateTime the date-time to format.
71+
* @param pattern the formatting pattern.
72+
* @return the formatted date-time, or {@code null} if dateTime is null.
7373
*/
7474
public static String format(LocalDateTime dateTime, String pattern) {
7575
if (dateTime == null) {
@@ -81,9 +81,9 @@ public static String format(LocalDateTime dateTime, String pattern) {
8181
/**
8282
* Parses a date string into a {@link LocalDate}.
8383
*
84-
* @param date the date string
85-
* @param pattern the date pattern
86-
* @return the parsed {@link LocalDate}, or {@code null} if input is null
84+
* @param date the date string.
85+
* @param pattern the date pattern.
86+
* @return the parsed {@link LocalDate}, or {@code null} if input is null.
8787
*/
8888
public static LocalDate parseDate(String date, String pattern) {
8989
if (date == null) {
@@ -95,9 +95,9 @@ public static LocalDate parseDate(String date, String pattern) {
9595
/**
9696
* Parses a date-time string into a {@link LocalDateTime}.
9797
*
98-
* @param dateTime the date-time string
99-
* @param pattern the date-time pattern
100-
* @return the parsed {@link LocalDateTime}, or {@code null} if input is null
98+
* @param dateTime the date-time string.
99+
* @param pattern the date-time pattern.
100+
* @return the parsed {@link LocalDateTime}, or {@code null} if input is null.
101101
*/
102102
public static LocalDateTime parseDateTime(String dateTime, String pattern) {
103103
if (dateTime == null) {
@@ -109,8 +109,8 @@ public static LocalDateTime parseDateTime(String dateTime, String pattern) {
109109
/**
110110
* Converts a Unix timestamp (seconds) to a {@link LocalDateTime}.
111111
*
112-
* @param timestampSeconds the Unix timestamp in seconds
113-
* @return the corresponding {@link LocalDateTime}
112+
* @param timestampSeconds the Unix timestamp in seconds.
113+
* @return the corresponding {@link LocalDateTime}.
114114
*/
115115
public static LocalDateTime fromTimestamp(long timestampSeconds) {
116116
return LocalDateTime.ofInstant(
@@ -122,8 +122,8 @@ public static LocalDateTime fromTimestamp(long timestampSeconds) {
122122
/**
123123
* Converts a {@link LocalDateTime} to a Unix timestamp (seconds).
124124
*
125-
* @param dateTime the date-time to convert
126-
* @return the Unix timestamp in seconds, or {@code null} if dateTime is null
125+
* @param dateTime the date-time to convert.
126+
* @return the Unix timestamp in seconds, or {@code null} if dateTime is null.
127127
*/
128128
public static Long toTimestamp(LocalDateTime dateTime) {
129129
if (dateTime == null) {
@@ -135,8 +135,8 @@ public static Long toTimestamp(LocalDateTime dateTime) {
135135
/**
136136
* Converts a legacy {@link Date} to {@link LocalDateTime}.
137137
*
138-
* @param date the {@link Date} to convert
139-
* @return the corresponding {@link LocalDateTime}, or {@code null} if date is null
138+
* @param date the {@link Date} to convert.
139+
* @return the corresponding {@link LocalDateTime}, or {@code null} if date is null.
140140
*/
141141
public static LocalDateTime toLocalDateTime(Date date) {
142142
if (date == null) {
@@ -148,8 +148,8 @@ public static LocalDateTime toLocalDateTime(Date date) {
148148
/**
149149
* Converts a {@link LocalDateTime} to legacy {@link Date}.
150150
*
151-
* @param dateTime the date-time to convert
152-
* @return the corresponding {@link Date}, or {@code null} if dateTime is null
151+
* @param dateTime the date-time to convert.
152+
* @return the corresponding {@link Date}, or {@code null} if dateTime is null.
153153
*/
154154
public static Date toDate(LocalDateTime dateTime) {
155155
if (dateTime == null) {
@@ -161,7 +161,7 @@ public static Date toDate(LocalDateTime dateTime) {
161161
/**
162162
* Returns the current date-time.
163163
*
164-
* @return the current {@link LocalDateTime}
164+
* @return the current {@link LocalDateTime}.
165165
*/
166166
public static LocalDateTime now() {
167167
return LocalDateTime.now();

cup-core/src/main/java/dev/rafandoo/cup/text/StringCase.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public final class StringCase {
2929
* "hello world java" -> "Hello World Java"
3030
* </pre>
3131
*
32-
* @param str the string to convert
33-
* @return the string in title case, or the original string if null or blank
32+
* @param str the string to convert.
33+
* @return the string in title case, or the original string if null or blank.
3434
*/
3535
public static String toTitleCase(String str) {
3636
if (StringValidator.isNullOrBlank(str)) {
@@ -55,8 +55,8 @@ public static String toTitleCase(String str) {
5555
* "jAVA" -> "Java"
5656
* </pre>
5757
*
58-
* @param str the string to capitalize
59-
* @return the capitalized string, or the original string if null or blank
58+
* @param str the string to capitalize.
59+
* @return the capitalized string, or the original string if null or blank.
6060
*/
6161
public static String capitalize(String str) {
6262
if (StringValidator.isNullOrBlank(str)) {
@@ -75,8 +75,8 @@ public static String capitalize(String str) {
7575
* "hello world java" -> "helloWorldJava"
7676
* </pre>
7777
*
78-
* @param str the string to convert
79-
* @return the string in camelCase, or the original string if null or blank
78+
* @param str the string to convert.
79+
* @return the string in camelCase, or the original string if null or blank.
8080
*/
8181
public static String toCamelCase(String str) {
8282
if (StringValidator.isNullOrBlank(str)) {
@@ -101,8 +101,8 @@ public static String toCamelCase(String str) {
101101
* "hello world java" -> "HelloWorldJava"
102102
* </pre>
103103
*
104-
* @param str the string to convert
105-
* @return the string in PascalCase, or the original string if null or blank
104+
* @param str the string to convert.
105+
* @return the string in PascalCase, or the original string if null or blank.
106106
*/
107107
public static String toPascalCase(String str) {
108108
if (StringValidator.isNullOrBlank(str)) {
@@ -134,8 +134,8 @@ public static String toPascalCase(String str) {
134134
* "helloWorld Java" -> "hello_world_java"
135135
* </pre>
136136
*
137-
* @param str the string to convert
138-
* @return the string in snake_case, or the original string if null or blank
137+
* @param str the string to convert.
138+
* @return the string in snake_case, or the original string if null or blank.
139139
*/
140140
public static String toSnakeCase(String str) {
141141
if (StringValidator.isNullOrBlank(str)) {
@@ -156,8 +156,8 @@ public static String toSnakeCase(String str) {
156156
* "HelloWorld Java" -> "hello-world-java"
157157
* </pre>
158158
*
159-
* @param str the string to convert
160-
* @return the string in kebab-case, or the original string if null or blank
159+
* @param str the string to convert.
160+
* @return the string in kebab-case, or the original string if null or blank.
161161
*/
162162
public static String toKebabCase(String str) {
163163
if (StringValidator.isNullOrBlank(str)) {

cup-core/src/main/java/dev/rafandoo/cup/text/StringNormalizer.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public final class StringNormalizer {
3838
* "ação" -> "acao"
3939
* </pre>
4040
*
41-
* @param str the string to process
42-
* @return the string without accents, or the original string if null or empty
41+
* @param str the string to process.
42+
* @return the string without accents, or the original string if null or empty.
4343
*/
4444
public static String removeAccents(String str) {
4545
if (StringValidator.isNullOrEmpty(str)) {
@@ -53,8 +53,8 @@ public static String removeAccents(String str) {
5353
/**
5454
* Removes all non-ASCII characters from a string.
5555
*
56-
* @param str the string to process
57-
* @return the string containing only ASCII characters, or the original string if null or empty
56+
* @param str the string to process.
57+
* @return the string containing only ASCII characters, or the original string if null or empty.
5858
*/
5959
public static String removeNonAscii(String str) {
6060
if (StringValidator.isNullOrEmpty(str)) {
@@ -70,8 +70,8 @@ public static String removeNonAscii(String str) {
7070
* This is a convenience method that combines
7171
* {@link #removeAccents(String)} and {@link #removeNonAscii(String)}.
7272
*
73-
* @param str the string to process
74-
* @return the normalized string, or the original string if null or empty
73+
* @param str the string to process.
74+
* @return the normalized string, or the original string if null or empty.
7575
*/
7676
public static String removeAccentsAndSpecialCharacters(String str) {
7777
if (StringValidator.isNullOrEmpty(str)) {
@@ -91,8 +91,8 @@ public static String removeAccentsAndSpecialCharacters(String str) {
9191
* " hello world " -> "hello world"
9292
* </pre>
9393
*
94-
* @param str the string to process
95-
* @return the whitespace-normalized string, or the original string if null or empty
94+
* @param str the string to process.
95+
* @return the whitespace-normalized string, or the original string if null or empty.
9696
*/
9797
public static String normalizeWhitespace(String str) {
9898
if (StringValidator.isNullOrEmpty(str)) {
@@ -107,8 +107,8 @@ public static String normalizeWhitespace(String str) {
107107
* <p>
108108
* Useful for comparisons, indexing, and search operations.
109109
*
110-
* @param str the string to normalize
111-
* @return a fully normalized string, or the original string if null or empty
110+
* @param str the string to normalize.
111+
* @return a fully normalized string, or the original string if null or empty.
112112
*/
113113
public static String normalizeForComparison(String str) {
114114
if (StringValidator.isNullOrEmpty(str)) {
@@ -129,9 +129,9 @@ public static String normalizeForComparison(String str) {
129129
* "Olá Mundo Java!" -> "ola-mundo-java"
130130
* </pre>
131131
*
132-
* @param str the string to normalize
133-
* @param delimiter the delimiter to use between words
134-
* @return a normalized identifier, or null if the input is null
132+
* @param str the string to normalize.
133+
* @param delimiter the delimiter to use between words.
134+
* @return a normalized identifier, or null if the input is null.
135135
*/
136136
public static String toSlug(String str, String delimiter) {
137137
if (str == null) {

cup-core/src/main/java/dev/rafandoo/cup/text/StringValidator.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public final class StringValidator {
1414
/**
1515
* Checks whether a string is {@code null} or empty.
1616
*
17-
* @param str the string to check
18-
* @return {@code true} if the string is {@code null} or empty, {@code false} otherwise
17+
* @param str the string to check.
18+
* @return {@code true} if the string is {@code null} or empty, {@code false} otherwise.
1919
*/
2020
public static boolean isNullOrEmpty(String str) {
2121
return str == null || str.isEmpty();
@@ -24,8 +24,8 @@ public static boolean isNullOrEmpty(String str) {
2424
/**
2525
* Checks whether a string is {@code null}, empty, or contains only whitespace characters.
2626
*
27-
* @param str the string to check
28-
* @return {@code true} if the string is {@code null}, empty, or blank, {@code false} otherwise
27+
* @param str the string to check.
28+
* @return {@code true} if the string is {@code null}, empty, or blank, {@code false} otherwise.
2929
*/
3030
public static boolean isNullOrBlank(String str) {
3131
return str == null || str.trim().isEmpty();
@@ -34,8 +34,8 @@ public static boolean isNullOrBlank(String str) {
3434
/**
3535
* Checks whether a string is not {@code null} and not empty.
3636
*
37-
* @param str the string to check
38-
* @return {@code true} if the string is not {@code null} and not empty
37+
* @param str the string to check.
38+
* @return {@code true} if the string is not {@code null} and not empty.
3939
*/
4040
public static boolean isNotEmpty(String str) {
4141
return !isNullOrEmpty(str);
@@ -44,8 +44,8 @@ public static boolean isNotEmpty(String str) {
4444
/**
4545
* Checks whether a string is not {@code null} and not blank.
4646
*
47-
* @param str the string to check
48-
* @return {@code true} if the string is not {@code null} and contains non-whitespace characters
47+
* @param str the string to check.
48+
* @return {@code true} if the string is not {@code null} and contains non-whitespace characters.
4949
*/
5050
public static boolean isNotBlank(String str) {
5151
return !isNullOrBlank(str);
@@ -56,8 +56,8 @@ public static boolean isNotBlank(String str) {
5656
* <p>
5757
* This method returns {@code false} for {@code null} or empty strings.
5858
*
59-
* @param str the string to check
60-
* @return {@code true} if the string contains only digits, {@code false} otherwise
59+
* @param str the string to check.
60+
* @return {@code true} if the string contains only digits, {@code false} otherwise.
6161
*/
6262
public static boolean isNumeric(String str) {
6363
if (isNullOrEmpty(str)) {
@@ -69,10 +69,10 @@ public static boolean isNumeric(String str) {
6969
/**
7070
* Checks whether a string has a length within a specified range.
7171
*
72-
* @param str the string to check
73-
* @param min minimum allowed length (inclusive)
74-
* @param max maximum allowed length (inclusive)
75-
* @return {@code true} if the string length is within the range
72+
* @param str the string to check.
73+
* @param min minimum allowed length (inclusive).
74+
* @param max maximum allowed length (inclusive).
75+
* @return {@code true} if the string length is within the range.
7676
*/
7777
public static boolean hasLengthBetween(String str, int min, int max) {
7878
if (str == null) {

0 commit comments

Comments
 (0)