blob: ffb8aee497e23bcd03ea54f368b67ba8b0b1f91b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/*******************************************************************************
* Copyright (c) 2013, 2017 Orange.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* BAREAU Cyrille <cyrille.bareau@orange.com>,
* BONNARDEL Gregory <gbonnardel.ext@orange.com>,
* BOLLE Sebastien <sebastien.bolle@orange.com>.
*******************************************************************************/
package org.eclipse.om2m.android.dashboard.utils;
import java.util.Collection;
import java.util.Map;
public class OTBUtils {
static public final boolean equals(final String s1, final String s2) {
return (s1 == null) ? (s2 == null) : s1.equals(s2);
}
static public final boolean isEmpty(final String s) {
return (s == null) || s.trim().isEmpty();
}
static public final boolean isEmpty(final Collection<?> c) {
return (c == null) || c.isEmpty();
}
static public final boolean isEmpty(final Map<?,?> c) {
return (c == null) || c.isEmpty();
}
static public final boolean isEmpty(final Object[] c) {
return (c == null) || (c.length == 0);
}
}
|