Android examples for java.lang:Boolean
get boolean value from java.lang.String, skip null value
/*/*from www . j a va2 s . c om*/ * File: $RCSfile: ObjectUtilities.java,v $ * * Copyright (c) 2009 Kewill, * * All Rights Reserved. * * This software is the confidential and proprietary information * of Kewill ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered * into with Kewill. */ //package com.java2s; public class Main { /** * get boolean value from <code>java.lang.String</code>, skip null value * * @param value <code>java.lang.value</code> * @return if value if null or its value is 0 return false, else return true */ public static boolean booleanValueForString(String value) { return "true".equals(value) || "1".equals(value); } }