I don't know how calls to hashCode can be chained. Is there anything that
can do that?

I can implement hashCode in final classes using Objects.hash(), but I
suppose it would be niche to be able to progressively build a hash code.

On Sun, 19 Apr 2020 at 17:09, Emilian Bold <emilian.b...@gmail.com> wrote:

> Interesting. Another idea might be to rely on super.hashCode and
> super.equals somewhere in there?
>
> --emi
>
>
> On Sun, Apr 19, 2020 at 6:00 AM Owen Thomas <owen.paul.tho...@gmail.com>
> wrote:
>
>> Hi. I'm using NB 11.0.
>>
>> I'm trying to override equals and hashCode for a subclass of a type that
>> extends object. The inherited class and the subclass both declare fields
>> and getters for them.
>>
>> It seems unfortunate to me that the NB wizard that one usually uses to
>> generate the code for equals and hashCode does not permit inherited fields
>> (or their getters, preferably, so the fields can remain private) to be used.
>>
>> Have others found this to be a bit of a frustration?
>>
>>   Owen.
>> --
>> I'll cut your code at an intensity and from a place of my own choosing.
>> Clique Space(TM). Anima ex machina.
>>
>

-- 
I'll cut your code at an intensity and from a place of my own choosing.
Clique Space(TM). Anima ex machina.

Reply via email to