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
@@ -926,14 +927,15 @@ public static String nullSafeToString(@Nullable short[] array) {
926
927
* <li>Potentially {@linkplain StringUtils#truncate(CharSequence) truncated string}
927
928
* if {@code obj} is a {@link String} or {@link CharSequence}</li>
928
929
* <li>Potentially {@linkplain StringUtils#truncate(CharSequence) truncated string}
929
- * if {@code obj} is a <em>simple type</em> whose {@code toString()} method returns
930
- * a non-null value.</li>
930
+ * if {@code obj} is a <em>simple value type</em> whose {@code toString()} method
931
+ * returns a non-null value.</li>
931
932
* <li>Otherwise, a string representation of the object's type name concatenated
932
933
* with {@code @} and a hex string form of the object's identity hash code</li>
933
934
* </ul>
934
- * <p>In the context of this method, a <em>simple type</em> is any of the following:
935
- * a primitive wrapper (excluding {@link Void}), an {@link Enum}, a {@link Number},
936
- * a {@link Date}, a {@link Temporal}, a {@link URI}, a {@link URL}, or a {@link Locale}.
935
+ * <p>In the context of this method, a <em>simple value type</em> is any of the following:
936
+ * a primitive wrapper (excluding {@code Void}), an {@code Enum}, a {@code Number},
937
+ * a {@code Date}, a {@code Temporal}, a {@code UUID}, a {@code URI}, a {@code URL},
938
+ * or a {@code Locale}.
937
939
* @param obj the object to build a string representation for
938
940
* @return a concise string representation of the supplied object
939
941
* @since 5.3.27
@@ -961,13 +963,8 @@ public static String nullSafeConciseToString(@Nullable Object obj) {
961
963
}
962
964
963
965
/**
964
- * Copy of {@link org.springframework.beans.BeanUtils#isSimpleValueType(Class)}.
965
- * <p>Check if the given type represents a "simple" value type: a primitive or
966
- * primitive wrapper, an enum, a String or other CharSequence, a Number, a
967
- * Date, a Temporal, a URI, a URL, a Locale, or a Class.
968
- * <p>{@code Void} and {@code void} are not considered simple value types.
969
- * @param type the type to check
970
- * @return whether the given type represents a "simple" value type
966
+ * Derived from {@link org.springframework.beans.BeanUtils#isSimpleValueType}.
967
+ * As of 5.3.28, considering {@code UUID} in addition to the bean-level check.
971
968
*/
972
969
private static boolean isSimpleValueType (Class <?> type ) {
973
970
return (Void .class != type && void .class != type &&
@@ -977,6 +974,7 @@ private static boolean isSimpleValueType(Class<?> type) {
977
974
Number .class .isAssignableFrom (type ) ||
978
975
Date .class .isAssignableFrom (type ) ||
979
976
Temporal .class .isAssignableFrom (type ) ||
977
+ UUID .class == type ||
980
978
URI .class == type ||
981
979
URL .class == type ||
982
980
Locale .class == type ||
0 commit comments