Boolean fields in XWikiDocument & BaseCollection

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Boolean fields in XWikiDocument & BaseCollection

Thomas Mortagne
Administrator
Hi XWikiers,

In BaseClass there is possibility to add Boolean type field with
"addBooleanField". In XwikiDocument (and then in BaseCollection), we
use "getIntValue" and "setIntValue" to retrieve or set the value with
0=false and 1=true. It's very simple but I think a
"get/setBooleanValue" that do the conversion would be much more
readable and avoid developper to search how boolean values are really
stored.

Regards,
Thomas Mortagne



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Boolean fields in XWikiDocument & BaseCollection

ebullient
On 7/30/07, Thomas Mortagne <[hidden email]> wrote:

> Hi XWikiers,
>
> In BaseClass there is possibility to add Boolean type field with
> "addBooleanField". In XwikiDocument (and then in BaseCollection), we
> use "getIntValue" and "setIntValue" to retrieve or set the value with
> 0=false and 1=true. It's very simple but I think a
> "get/setBooleanValue" that do the conversion would be much more
> readable and avoid developper to search how boolean values are really
> stored.
>
> Regards,
> Thomas Mortagne
Agreed. Every time I use a Boolean value, I have to remember this. I
don't do it so often that it's ingrained.. :-P

--
'Waste of a good apple' -Samwise Gamgee



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Boolean fields in XWikiDocument & BaseCollection

Sergiu Dumitriu
The problem is that boolean fields also have -1 as a possible value,
which means "not specified". So there will be a problem with this,
since we can't tell what 'not specified' should be, true or false.

On 7/30/07, Erin Schnabel <[hidden email]> wrote:

> On 7/30/07, Thomas Mortagne <[hidden email]> wrote:
> > Hi XWikiers,
> >
> > In BaseClass there is possibility to add Boolean type field with
> > "addBooleanField". In XwikiDocument (and then in BaseCollection), we
> > use "getIntValue" and "setIntValue" to retrieve or set the value with
> > 0=false and 1=true. It's very simple but I think a
> > "get/setBooleanValue" that do the conversion would be much more
> > readable and avoid developper to search how boolean values are really
> > stored.
> >
> > Regards,
> > Thomas Mortagne
>
> Agreed. Every time I use a Boolean value, I have to remember this. I
> don't do it so often that it's ingrained.. :-P
>
Sergiu
--
http://purl.org/net/sergiu



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Boolean fields in XWikiDocument & BaseCollection

Thomas Mortagne
Administrator
We can use java Boolean type, in place of boolean, that can be true,
false or null has any java Object.

2007/7/31, Sergiu Dumitriu <[hidden email]>:

> The problem is that boolean fields also have -1 as a possible value,
> which means "not specified". So there will be a problem with this,
> since we can't tell what 'not specified' should be, true or false.
>
> On 7/30/07, Erin Schnabel <[hidden email]> wrote:
> > On 7/30/07, Thomas Mortagne <[hidden email]> wrote:
> > > Hi XWikiers,
> > >
> > > In BaseClass there is possibility to add Boolean type field with
> > > "addBooleanField". In XwikiDocument (and then in BaseCollection), we
> > > use "getIntValue" and "setIntValue" to retrieve or set the value with
> > > 0=false and 1=true. It's very simple but I think a
> > > "get/setBooleanValue" that do the conversion would be much more
> > > readable and avoid developper to search how boolean values are really
> > > stored.
> > >
> > > Regards,
> > > Thomas Mortagne
> >
> > Agreed. Every time I use a Boolean value, I have to remember this. I
> > don't do it so often that it's ingrained.. :-P
> >
>
> Sergiu
> --
> http://purl.org/net/sergiu
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
--
Thomas Mortagne



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws