commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pascal Schumacher (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1330) EqualsBuilder should be able to call custom equals method for specified class
Date Wed, 10 May 2017 14:43:04 GMT

    [ https://issues.apache.org/jira/browse/LANG-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004798#comment-16004798
] 

Pascal Schumacher commented on LANG-1330:
-----------------------------------------

If I understand this correctly, this is a duplicate of [https://issues.apache.org/jira/browse/LANG-1249].

> EqualsBuilder should be able to call custom equals method for specified class
> -----------------------------------------------------------------------------
>
>                 Key: LANG-1330
>                 URL: https://issues.apache.org/jira/browse/LANG-1330
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Jason Smiley
>
> As a tester, there are times I want to exclude certain fields (like ID) for my parent
object and its children.
> For example:
> {code}
> class Parent {
> public String id;
> public NormalChild child1;
> public SpecialChild child2;
> //uses ReflectionEqualsBuilder for equals();
> //has custom equalsWithoutID() method;
> }
> class NormalChild extend Child {
> public String name;
> //uses ReflectionEqualsBuilder equals();
> //has custom equalsWithoutID() method via inheritance;
> }
> class SpecialChild extend Child {
> public String id;
> public String name;
> //uses ReflectionEqualsBuilder for equals();
> //has custom equalsWithoutID() method via inheritence;
> }
> {code}
> If I am running a reflectionEquals with excluding field "id" on my parent object, the
excludedFields won't be used on my children classes (only excludes fields of parent with name).
I would like to be able to call the custom equalsWithoutID() if its an instance of class Child.
> Currently i need to do a workaround where my equals() checks to see which method I was
using before executing but its not an ideal solution.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message