27
27
import java .util .Map ;
28
28
import java .util .Optional ;
29
29
import java .util .StringJoiner ;
30
+ import java .util .UUID ;
30
31
31
32
import org .springframework .lang .Nullable ;
32
33
@@ -903,14 +904,15 @@ public static String nullSafeToString(@Nullable short[] array) {
903
904
* <li>Potentially {@linkplain StringUtils#truncate(CharSequence) truncated string}
904
905
* if {@code obj} is a {@link String} or {@link CharSequence}</li>
905
906
* <li>Potentially {@linkplain StringUtils#truncate(CharSequence) truncated string}
906
- * if {@code obj} is a <em>simple type</em> whose {@code toString()} method returns
907
- * a non-null value.</li>
907
+ * if {@code obj} is a <em>simple value type</em> whose {@code toString()} method
908
+ * returns a non-null value.</li>
908
909
* <li>Otherwise, a string representation of the object's type name concatenated
909
910
* with {@code @} and a hex string form of the object's identity hash code</li>
910
911
* </ul>
911
- * <p>In the context of this method, a <em>simple type</em> is any of the following:
912
- * a primitive wrapper (excluding {@link Void}), an {@link Enum}, a {@link Number},
913
- * a {@link Date}, a {@link Temporal}, a {@link URI}, a {@link URL}, or a {@link Locale}.
912
+ * <p>In the context of this method, a <em>simple value type</em> is any of the following:
913
+ * a primitive wrapper (excluding {@code Void}), an {@code Enum}, a {@code Number},
914
+ * a {@code Date}, a {@code Temporal}, a {@code UUID}, a {@code URI}, a {@code URL},
915
+ * or a {@code Locale}.
914
916
* @param obj the object to build a string representation for
915
917
* @return a concise string representation of the supplied object
916
918
* @since 5.3.27
@@ -938,13 +940,7 @@ public static String nullSafeConciseToString(@Nullable Object obj) {
938
940
}
939
941
940
942
/**
941
- * Copy of {@link org.springframework.beans.BeanUtils#isSimpleValueType(Class)}.
942
- * <p>Check if the given type represents a "simple" value type: a primitive or
943
- * primitive wrapper, an enum, a String or other CharSequence, a Number, a
944
- * Date, a Temporal, a URI, a URL, a Locale, or a Class.
945
- * <p>{@code Void} and {@code void} are not considered simple value types.
946
- * @param type the type to check
947
- * @return whether the given type represents a "simple" value type
943
+ * Derived from {@link org.springframework.beans.BeanUtils#isSimpleValueType}.
948
944
*/
949
945
private static boolean isSimpleValueType (Class <?> type ) {
950
946
return (Void .class != type && void .class != type &&
@@ -954,6 +950,7 @@ private static boolean isSimpleValueType(Class<?> type) {
954
950
Number .class .isAssignableFrom (type ) ||
955
951
Date .class .isAssignableFrom (type ) ||
956
952
Temporal .class .isAssignableFrom (type ) ||
953
+ UUID .class .isAssignableFrom (type ) ||
957
954
URI .class == type ||
958
955
URL .class == type ||
959
956
Locale .class == type ||
0 commit comments