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: full changeset including rene's comments Created July 26, 2016, 1:38 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)
René Jeschke 2016/07/28 11:46:22 We're using two-space indentation. ;-)
anton 2016/07/28 11:48:59 Yes, i know. I've been thinking we can approve the
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)
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 = array[i].toString();
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
« no previous file with comments | « src/org/adblockplus/android/ProxyService.java ('k') | src/org/adblockplus/brazil/RequestHandler.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld