Here you can find the source of boolean2XML(Boolean b)
Parameter | Description |
---|---|
b | boolean (true/false) |
public static String boolean2XML(Boolean b)
//package com.java2s; /******************************************************************************* * Copyright (c) 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are 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 * * Contributors:/*from w w w. ja v a2 s. co m*/ * IBM Corporation - initial API and implementation *******************************************************************************/ public class Main { /** * Boolean as XML version string. * * @param b * boolean (true/false) * @return "yes" or "no" */ public static String boolean2XML(Boolean b) { if (b == null || b.equals(Boolean.FALSE)) { return "no"; } return "yes"; } /** * Boolean as XML version string. * * @param b * boolean (true/false) * @return "yes" or "no" */ public static String boolean2XML(boolean b) { if (!b) { return "no"; } return "yes"; } }