make observer list modifiable #3825 (task1)
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / service / Utils.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.cdm.remote.service;
11
12 import org.springframework.stereotype.Component;
13
14
15 public class Utils {
16
17 /**
18 * Interprets a string as boolean value with true/TRUE/True or any integer greater 0 being true
19 * @param boolString
20 * @return
21 */
22 public static Boolean isTrue(String boolString){
23 // empty string returns null
24 if (boolString==null || boolString.trim().length()==0){
25 return null;
26 }
27 boolean result = Boolean.parseBoolean(boolString);
28 try{
29 if (!result && Integer.valueOf(boolString)>0){
30 result = true;
31 }
32 }catch(Exception e){
33 result = false;
34 }
35 return result;
36 }
37 }