com.sage.orion.sdata.servlet
Class XMLBoolean

java.lang.Object
  extended by com.sage.orion.sdata.servlet.XMLBoolean

public final class XMLBoolean
extends java.lang.Object

A utility class for translating booleans to and from XML


Constructor Summary
XMLBoolean()
           
 
Method Summary
static java.lang.String of(boolean value)
          returns the String representation of the boolean value
static boolean of(java.lang.String value)
          returns the boolean representation of the String value
static boolean of(java.lang.String value, boolean defaultValue)
          returns the boolean representation of the String value, or the default if the string is null or empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLBoolean

public XMLBoolean()
Method Detail

of

public static final java.lang.String of(boolean value)
returns the String representation of the boolean value

Parameters:
value - the value to be translated
Returns:
the String representation of the value

of

public static final boolean of(java.lang.String value)
returns the boolean representation of the String value

Unlike the of(String, boolean) version this version regards an empty string as false.

Parameters:
value - the value to be translated. This must not be null. If this value might be null use of(String, boolean). The value is used untrimmed; remember to trim the String if it might contain leading or trailing spaces.
Returns:
the boolean representation of the value.

of

public static final boolean of(java.lang.String value,
                               boolean defaultValue)
returns the boolean representation of the String value, or the default if the string is null or empty.

The value is regarded as empty if it contains no characters. The value is not trimmed in any way.

Parameters:
value - the value to be translated. This may be a null reference. in which case the default will be returned.
defaultValue - the default value to return if the value is null or empty
Returns:
the boolean representation of the value


Copyright © 2011 Sage Software, Inc. All rights reserved.