|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taco.util.BooleanMapper
public final class BooleanMapper
An implementation of IObjectMapper
that returns a
Boolean
which represents an object.
Field Summary | |
---|---|
static BooleanMapper |
instance
The singleton instance of this class. |
Method Summary | |
---|---|
java.lang.Object |
map(java.lang.Object obj)
If obj is null , return FALSE . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final BooleanMapper instance
Method Detail |
---|
public java.lang.Object map(java.lang.Object obj)
null
, return FALSE
. If
obj
is a Boolean
, return obj
itself. If obj
is an instance of Number
,
return FALSE
iff the int value of obj
is 0.
If obj
is an instance of CharSequence
or
Object[]
, return FALSE
iff the length is 0.
If obj is an instance of Collection
or Map
,
return FALSE
iff the size is 0. Otherwise, return
TRUE
. One tricky point: if obj
is "false",
this method still returns TRUE
since obj
is
non-empty.
map
in interface IObjectMapper
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |