Skip to content

Commit 5a4823a

Browse files
committed
Add useful safe equals for comparing Strings
1 parent a12fddb commit 5a4823a

File tree

1 file changed

+8
-0
lines changed
  • src/AndroidClient/client/src/main/java/net/servicestack/client

1 file changed

+8
-0
lines changed

src/AndroidClient/client/src/main/java/net/servicestack/client/Utils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,4 +529,12 @@ public static <K,V> HashMap<K,V> createMap(K k1, V v1, K k2, V v2, K k3, V v3) {
529529
to.put(k3, v3);
530530
return to;
531531
}
532+
533+
public static boolean equals(String s1, String s2){
534+
if (s1 == null)
535+
return s2 == null;
536+
if (s2 == null)
537+
return s1 == null;
538+
return s1.equals(s2);
539+
}
532540
}

0 commit comments

Comments
 (0)