Java tutorial
//package com.java2s; /******************************************************************************* * Copyright (c) 2007 Red Hat, Inc. * Distributed under license by Red Hat, Inc. All rights reserved. * This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributor: * Red Hat, Inc. - initial API and implementation ******************************************************************************/ public class Main { /** * Parses string value retrieved from sourceElement.getAttribure(..) method * to its boolean value. * <p> * <code>true</code> is returned only if it specified explicitly, otherwise * <code>false</code> is returned. * * @param str * the string to parse * @return boolean value from string */ public static boolean string2boolean(String str) { return Boolean.parseBoolean(str); } }