|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.formatter.Formatter
ariba.util.formatter.SystemBooleanFormatter
public class SystemBooleanFormatter
SystemBooleanFormatter
is a subclass of
Formatter
which is responsible for formatting,
parsing, and comparing boolean
values and/or
Boolean
objects.
The values produced will always be 'true' or 'false' no matter the locale being used.
Field Summary | |
---|---|
static java.lang.String |
ClassName
Our Java class name. |
Fields inherited from interface ariba.util.core.Compare |
---|
EqualTo, GreaterThan, LessThan |
Constructor Summary | |
---|---|
SystemBooleanFormatter()
Creates a new SystemBooleanFormatter . |
Method Summary | |
---|---|
static int |
compareBooleans(boolean b1,
boolean b2)
Compares two boolean values for sorting purposes. |
static int |
compareBooleans(java.lang.Boolean b1,
java.lang.Boolean b2)
Compares two Boolean objects for sorting purposes. |
static boolean |
getBooleanValue(java.lang.Object object)
Returns a boolean value derived from the given
object. |
static java.lang.String |
getStringValue(java.lang.Boolean object)
Returns a formatted string for the given Boolean object
in the default locale. |
static java.lang.String |
getStringValue(java.lang.Boolean object,
java.util.Locale locale)
Deprecated. use getStringValue(Boolean) instead. |
java.lang.Object |
getValue(java.lang.Object object,
java.util.Locale locale)
Returns a new Boolean derived from the given object. |
static boolean |
parseBoolean(java.lang.String string)
Parses the given string as a boolean value. |
static java.lang.Boolean |
parseStringAsBoolean(java.lang.String string)
Parses the given string as a Boolean value. |
Methods inherited from class ariba.util.formatter.Formatter |
---|
canFormatNulls, compare, compare, equal, equal, getFormat, getFormat, getFormatterClassForType, getFormatterForObject, getFormatterForType, getLocale, getStringValue, getStringValue, getValue, handlesNulls, isBidirectional, makeParseException, makeParseException, makeParseException, makeParseExceptionMessage, makeParseExceptionMessage, objectsAreEqual, objectsAreEqual, parse, parse, parseString, parseString, quickCompare, quickCompare, quickCompareValue, registerFormatter |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ClassName
Constructor Detail |
---|
public SystemBooleanFormatter()
SystemBooleanFormatter
.
Method Detail |
---|
public static java.lang.String getStringValue(java.lang.Boolean object)
Boolean
object
in the default locale.
object
- the Boolean
object to format into a string
Boolean
public static java.lang.String getStringValue(java.lang.Boolean object, java.util.Locale locale)
Boolean
object
object
- the Boolean
object to format into a stringlocale
- the Locale
to use for formatting
Boolean
object in the given localepublic static boolean parseBoolean(java.lang.String string)
boolean
value.
Returns true if and only if the given string is
"true"
, or if the value is
"BooleanTrue"
.
string
- the String
to parse
true
if the given string is
"true"
; false
otherwise.public static java.lang.Boolean parseStringAsBoolean(java.lang.String string)
Boolean
value.
Returns Boolean.TRUE
if and only if the given
string is "true"
or "BooleanTrue"
.
string
- the String
to parse
Boolean.TRUE
if the given string is
"true"
; Boolean.FALSE
otherwise.public static boolean getBooleanValue(java.lang.Object object)
boolean
value derived from the given
object. If the object is not a Boolean
, it is
converted to a string and compared against the string
"true"
or "BooleanTrue"
.
object
- the object to covert to a boolean
boolean
derived from the given objectpublic static int compareBooleans(java.lang.Boolean b1, java.lang.Boolean b2)
Boolean
objects for sorting purposes.
Returns an int
value which is less than, equal to, or
greater than zero depending on whether the first object sorts before,
the same, or after the second object. Sorts Boolean.TRUE
before Boolean.FALSE
.
b1
- the first Boolean
to compareb2
- the second Boolean
to compare
int
value which determines how the two objects
should be orderedpublic static int compareBooleans(boolean b1, boolean b2)
boolean
values for sorting purposes.
Returns an int
value which is less than, equal to, or
greater than zero depending on whether the first object sorts before,
the same, or after the second object. Sorts true
before
false
.
b1
- the first boolean
to compareb2
- the second boolean
to compare
int
value which determines how the two objects
should be orderedpublic java.lang.Object getValue(java.lang.Object object, java.util.Locale locale)
Boolean
derived from the given object. If
the object is not a Boolean
, it is converted to a string
and compared against the string "true"
.
getValue
in class Formatter
object
- the object to convert to a Boolean
locale
- the Locale
to use for conversion
Boolean
derived from the given object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |