Project

General

Profile

Download (840 Bytes) Statistics
| Branch: | Tag: | Revision:
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

    
13
public class Utils {
14
	
15
	/**
16
	 * Interprets a string as boolean value with true/TRUE/True or any integer greater 0 being true
17
	 * @param boolString
18
	 * @return
19
	 */
20
	public static Boolean isTrue(String boolString){
21
		// empty string returns null
22
		if (boolString==null || boolString.trim().length()==0){
23
			return null;
24
		}
25
		boolean result = Boolean.parseBoolean(boolString);
26
		try{
27
			if (!result && Integer.valueOf(boolString)>0){
28
				result = true;
29
			}
30
		}catch(Exception e){
31
			result = false;
32
		}
33
		return result;
34
	}
35
}
(5-5/5)