commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <brit...@apache.org>
Subject Re: [lang] Boolean method names
Date Fri, 28 Apr 2017 07:26:44 GMT
Hello Mark,

> Am 25.04.2017 um 23:23 schrieb Mark Dacek <mark@syberion.com>:
> 
> Hello all -
> Recently, LANG-1167 was merged into commons-lang. It hit me today that one
> of these method names seems a little funky. The class in question is
> ReflectionToStringBuilder :
> *https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java#L719-L729
> <https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java#L719-L729>*
> 
> I added a boolean called "excludeNullValues" - this seems fairly
> straightforward, but the generic getter for this would be called
> "isExcludeNullValues".
> 
> Is it acceptable/worthwhile to change the method name to something a little
> more intuitive to the end-user? Maybe something like "excludesNullValues"
> or "isExcludingNullValues“.

JavaBeans convention can lead to strange names. I’d suggest to stick to the convention.
This will make it easier for tools to process the properties.

> 
> 
> Perhaps the variable name could be changed as well, but it's in line with
> the others (e.g., "outputTransients", but negated).
> 
> Thanks for your consideration.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message