5757import java .util .Iterator ;
5858import java .util .Locale ;
5959import java .util .Map ;
60+ import java .util .Objects ;
6061import java .util .StringTokenizer ;
6162
6263/**
@@ -258,10 +259,12 @@ public static boolean isNotBlank( String str )
258259 * @param str1 the first string
259260 * @param str2 the second string
260261 * @return <code>true</code> if the Strings are equal, case sensitive, or both <code>null</code>
262+ * @see Objects#equals(Object, Object)
261263 */
264+ @ Deprecated
262265 public static boolean equals ( String str1 , String str2 )
263266 {
264- return ( str1 == null ? str2 == null : str1 .equals ( str2 ) );
267+ return Objects .equals ( str1 , str2 );
265268 }
266269
267270 /**
@@ -2038,7 +2041,9 @@ public static boolean isNumericSpace( String str )
20382041 *
20392042 * @param obj the Object to check
20402043 * @return the passed in Object's toString, or blank if it was <code>null</code>
2044+ * @see Objects#toString(Object, String)
20412045 */
2046+ @ Deprecated
20422047 public static String defaultString ( Object obj )
20432048 {
20442049 return defaultString ( obj , "" );
@@ -2053,10 +2058,12 @@ public static String defaultString( Object obj )
20532058 * @param obj the Object to check
20542059 * @param defaultString the default String to return if str is <code>null</code>
20552060 * @return the passed in string, or the default if it was <code>null</code>
2061+ * @see Objects#toString(Object, String)
20562062 */
2063+ @ Deprecated
20572064 public static String defaultString ( Object obj , String defaultString )
20582065 {
2059- return ( obj == null ) ? defaultString : obj . toString ( );
2066+ return Objects . toString ( obj , defaultString );
20602067 }
20612068
20622069 // Reversing
0 commit comments