Skip to content

Commit 87af34e

Browse files
committed
update javadoc for utils methods
1 parent ddda59e commit 87af34e

5 files changed

Lines changed: 25 additions & 9 deletions

File tree

rlib-common/src/main/java/com/ss/rlib/common/util/ArrayUtils.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,11 @@ public static <T> void fill(@NotNull T[] array, @NotNull IntFunction<T> factory)
158158
/**
159159
* Fill the array using the factory.
160160
*
161+
* @param <T> the element's type.
162+
* @param <F> the argument's type.
161163
* @param array the array.
162164
* @param argument the additional argument.
163165
* @param factory the element's factory.
164-
* @param <T> the element's type.
165166
*/
166167
public static <T, F> void fill(@NotNull T[] array, @Nullable F argument, @NotNull Function<F, T> factory) {
167168
for (int i = 0; i < array.length; i++) {
@@ -577,6 +578,7 @@ public static <T> void sort(@NotNull final T[] array, final int fromIndex, final
577578
/**
578579
* Convert the array to a string presentation.
579580
*
581+
* @param <T> the element's type.
580582
* @param array the array.
581583
* @param toString the to string function.
582584
* @return the string presentation.
@@ -587,11 +589,11 @@ public static <T> void sort(@NotNull final T[] array, final int fromIndex, final
587589
return "[]";
588590
}
589591

590-
String className = array.array()
592+
var className = array.array()
591593
.getClass()
592594
.getSimpleName();
593595

594-
StringBuilder builder = new StringBuilder(className.substring(0, className.length() - 1));
596+
var builder = new StringBuilder(className.substring(0, className.length() - 1));
595597

596598
for (int i = 0, length = array.size() - 1; i <= length; i++) {
597599

@@ -1890,11 +1892,12 @@ public static boolean isEmpty(@Nullable double[] array) {
18901892
/**
18911893
* Create a new array with mapped each element from source array.
18921894
*
1895+
* @param <T> the source component type.
1896+
* @param <M> the mapped element's type.
1897+
* @param <R> the result element's type.
18931898
* @param source the source array.
18941899
* @param mapper the mapper.
18951900
* @param resultType the result component type.
1896-
* @param <T> the source component type.
1897-
* @param <R> the result component type.
18981901
* @return the mapped array or null.
18991902
* @since 9.3.0
19001903
*/

rlib-common/src/main/java/com/ss/rlib/common/util/ObjectUtils.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@
1717
public final class ObjectUtils {
1818

1919
/**
20+
* @param <T> the object's type.
21+
* @param obj the object to check on not null.
22+
* @param message the message for exception if the object is null.
23+
* @return the passed object if it is not null.
2024
* @see Objects#requireNonNull(Object, String)
2125
*/
2226
public static <T> @NotNull T notNull(@Nullable T obj, @NotNull String message) {
2327
return Objects.requireNonNull(obj, message);
2428
}
2529

2630
/**
31+
* @param <T> the object's type.
32+
* @param obj the object to check on not null.
33+
* @return the passed object if it is not null.
2734
* @see Objects#requireNonNull(Object)
2835
*/
2936
public static <T> @NotNull T notNull(@Nullable T obj) {
@@ -33,6 +40,7 @@ public final class ObjectUtils {
3340
/**
3441
* Check the object to be not null. If the object is null this method throws an exception from the supplier.
3542
*
43+
* @param <T> the object's type.
3644
* @param obj the checked object.
3745
* @param supplier the exception factory.
3846
* @return the object.
@@ -50,6 +58,8 @@ public final class ObjectUtils {
5058
/**
5159
* Check the object to be not null. If the object is null this method throws an exception from the factory.
5260
*
61+
* @param <T> the object's type.
62+
* @param <F> the argument's type.
5363
* @param obj the checked object.
5464
* @param arg the argument for the exception factory.
5565
* @param factory the exception factory.
@@ -72,6 +82,7 @@ public final class ObjectUtils {
7282
/**
7383
* Check the object to be not null. If the object is null this method throws an exception from the factory.
7484
*
85+
* @param <T> the object's type.
7586
* @param obj the checked object.
7687
* @param arg the argument for the exception factory.
7788
* @param factory the exception factory.

rlib-common/src/main/java/com/ss/rlib/common/util/StringUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,9 @@ public static int length(@Nullable String string) {
452452
* Replace the variables in the string.
453453
*
454454
* @param string the source string.
455-
* @param params the variable's parameters, name -> val, name -> val.
455+
* @param params the variable's parameters, name -&gt; val, name -&gt; val.
456456
* @return result string.
457-
* @throws IllegalArgumentException if params count < 2 or % 2 != 0
457+
* @throws IllegalArgumentException if params count &lt; 2 or % 2 != 0
458458
*/
459459
public static @NotNull String replace(@NotNull String string, @NotNull String... params) {
460460

rlib-common/src/main/java/com/ss/rlib/common/util/Utils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ public static <F, S> void unchecked(
276276
* @param <R> the result's type.
277277
* @param argument the argument.
278278
* @param function the function.
279+
* @param def the default value.
279280
* @return the result or null.
280281
* @since 9.3.0
281282
*/
@@ -296,7 +297,8 @@ public static <F, S> void unchecked(
296297
* Try to execute a function with some result and convert this result to another.
297298
*
298299
* @param <F> the argument's type.
299-
* @param <R> the result's type.
300+
* @param <R> the function result's type.
301+
* @param <FR> the converter result's type.
300302
* @param argument the argument.
301303
* @param function the function.
302304
* @param resultConverter the result converter.

rlib-mail/src/main/java/com/ss/rlib/mail/sender/MailSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public interface MailSender {
2525
* @param subject the subject.
2626
* @param content the email's content.
2727
* @return the async result of sending process.
28-
* @throws CompletionException -> UncheckedMessagingException if something was wrong.
28+
* @throws CompletionException -&gt; UncheckedMessagingException if something was wrong.
2929
*/
3030
@NotNull CompletableFuture<Void> sendAsync(@NotNull String email, @NotNull String subject, @NotNull String content);
3131
}

0 commit comments

Comments
 (0)