Project

General

Profile

Download (832 Bytes) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.remote.service;
10

    
11

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