Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/org/adblockplus/android/StringUtils.java

Issue 29348632: Issue 4260 - Replace Apache Commons Lang classes (Closed)
Patch Set: Created July 22, 2016, 5:58 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH
4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 package org.adblockplus.android;
19
20 public class StringUtils
21 {
22 public static boolean isNotEmpty(String value)
23 {
24 return value != null && value.length() > 0;
25 }
26
27 public static boolean isEmpty(String value)
28 {
29 return !isNotEmpty(value);
30 }
31
32 public static String join(Object[] array, String separator)
anton 2016/07/22 18:02:17 tested according to https://commons.apache.org/pro
33 {
34 if (array == null)
35 {
36 return null;
37 }
38
39 StringBuilder sb = new StringBuilder();
40 for (int i = 0; i < array.length; i++)
41 {
42 String eachValue = (String)array[i];
anton 2016/07/26 12:45:38 this could be array[i].toString() but currently wo
René Jeschke 2016/07/26 13:14:44 Yeah. As we pass in 'Object[]' I really would love
anton 2016/07/26 13:22:04 Acknowledged.
43 if (i > 0 && separator != null)
44 {
45 sb.append(separator);
46 }
47
48 if (eachValue != null)
49 {
50 sb.append(eachValue);
51 }
52 }
53
54 return sb.toString();
55 }
56 }
OLDNEW

Powered by Google App Engine
This is Rietveld