Index: src/org/adblockplus/android/StringUtils.java |
diff --git a/src/org/adblockplus/android/StringUtils.java b/src/org/adblockplus/android/StringUtils.java |
index be7c0af193d9c371c4ede9ea9c5847db44e57761..3af67b321b1fa25445c8055c4ae133219fb574cf 100644 |
--- a/src/org/adblockplus/android/StringUtils.java |
+++ b/src/org/adblockplus/android/StringUtils.java |
@@ -19,38 +19,38 @@ package org.adblockplus.android; |
public class StringUtils |
Felix Dahlke
2016/09/12 15:53:28
Might be worth a doc comment that this is supposed
anton
2016/09/13 06:27:14
Actually this class has exactly the same methods s
Felix Dahlke
2016/09/13 08:23:29
Fair enough, let's leave it as is.
anton
2016/09/13 10:39:04
Acknowledged.
|
{ |
- public static boolean isNotEmpty(String value) |
- { |
- return value != null && value.length() > 0; |
- } |
+ public static boolean isNotEmpty(String value) |
+ { |
+ return value != null && value.length() > 0; |
+ } |
+ |
+ public static boolean isEmpty(String value) |
+ { |
+ return !isNotEmpty(value); |
+ } |
- public static boolean isEmpty(String value) |
+ public static String join(Object[] array, String separator) |
+ { |
+ if (array == null) |
{ |
- return !isNotEmpty(value); |
+ return null; |
} |
- public static String join(Object[] array, String separator) |
+ StringBuilder sb = new StringBuilder(); |
+ for (int i = 0; i < array.length; i++) |
{ |
- if (array == null) |
- { |
- return null; |
- } |
+ String eachValue = array[i].toString(); |
+ if (i > 0 && separator != null) |
+ { |
+ sb.append(separator); |
+ } |
- StringBuilder sb = new StringBuilder(); |
- for (int i = 0; i < array.length; i++) |
- { |
- String eachValue = array[i].toString(); |
- if (i > 0 && separator != null) |
- { |
- sb.append(separator); |
- } |
- |
- if (eachValue != null) |
- { |
- sb.append(eachValue); |
- } |
- } |
- |
- return sb.toString(); |
+ if (eachValue != null) |
Felix Dahlke
2016/09/12 15:53:28
So if the value is null, we'd just print the separ
anton
2016/09/13 06:27:14
There is a difference between null string and empt
Felix Dahlke
2016/09/13 08:23:29
Makes sense, just wanted to make sure that's the i
anton
2016/09/13 10:39:04
Acknowledged.
|
+ { |
+ sb.append(eachValue); |
+ } |
} |
+ |
+ return sb.toString(); |
+ } |
} |