You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Gary Gregory <ga...@gmail.com> on 2017/12/12 07:01:00 UTC

BasicRequestLine with hashCode() and equals()

Hi All:

I'd like to have BasicRequestLine implement equals() (and hashCode()).

Anyone against that?

Gary

Re: BasicRequestLine with hashCode() and equals()

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2017-12-12 at 06:54 -0700, Gary Gregory wrote:
> My use case is not a map but rewriting a request in a proxy where
> anything
> can be tweaked by users. If the request line I built is different at
> all
> from the original, then there are a few extra things I need to do.
> Using
> equals instead of testing all parts is simpler.
> 

I am not sure I understand the need for #hashCode #equals if you do not
intend to use BasicRequestLine in collections. You might as well create
a custom Comparator or add convenience method you deem appropriate
without abusing #hashCode/#equals contract.

Oleg

> Gary
> 
> On Dec 12, 2017 02:01, "Oleg Kalnichevski" <ol...@apache.org> wrote:
> 
> > On Tue, 2017-12-12 at 00:01 -0700, Gary Gregory wrote:
> > > Hi All:
> > > 
> > > I'd like to have BasicRequestLine implement equals() (and
> > > hashCode()).
> > > 
> > > Anyone against that?
> > > 
> > > Gary
> > 
> > What would be the criteria of equality? Why would one ever want to
> > stick BasicRequestLine instances into a map?
> > 
> > Oleg
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> > 
> > 

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


Re: BasicRequestLine with hashCode() and equals()

Posted by Gary Gregory <ga...@gmail.com>.
My use case is not a map but rewriting a request in a proxy where anything
can be tweaked by users. If the request line I built is different at all
from the original, then there are a few extra things I need to do. Using
equals instead of testing all parts is simpler.

Gary

On Dec 12, 2017 02:01, "Oleg Kalnichevski" <ol...@apache.org> wrote:

> On Tue, 2017-12-12 at 00:01 -0700, Gary Gregory wrote:
> > Hi All:
> >
> > I'd like to have BasicRequestLine implement equals() (and
> > hashCode()).
> >
> > Anyone against that?
> >
> > Gary
>
> What would be the criteria of equality? Why would one ever want to
> stick BasicRequestLine instances into a map?
>
> Oleg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: BasicRequestLine with hashCode() and equals()

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2017-12-12 at 00:01 -0700, Gary Gregory wrote:
> Hi All:
> 
> I'd like to have BasicRequestLine implement equals() (and
> hashCode()).
> 
> Anyone against that?
> 
> Gary

What would be the criteria of equality? Why would one ever want to
stick BasicRequestLine instances into a map?

Oleg

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