Re: 5.2.3 Boolean Bugs?????
Re: 5.2.3 Boolean Bugs?????
- Subject: Re: 5.2.3 Boolean Bugs?????
- From: Anthony Paras <email@hidden>
- Date: Thu, 18 Mar 2004 19:49:28 -0500
On 3/18/04 4:12 PM, "Jonathan Rochkind" <email@hidden> wrote:
> I've said it before, and I'll say it again now: My conclusion is do
> NOT model boolean attributes at all. I think you're in for all sorts
That's been my approach too. Lately, I came up with this helper class
method that does exactly what I want -- no more, no less:
public static boolean booleanValue(Number number) {
if (number == null) {
throw new RuntimeException("The number NULL could not be converted
to a boolean");
}
if (number.intValue() == 1) {
return true;
}
if (number.intValue() == 0) {
return false;
}
throw new RuntimeException("The number " + number + " could not be
converted to a boolean");
}
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.