frankiesardo / auto-parcel

Android Parcelable models made easy
Eclipse Public License 1.0
1.37k stars 83 forks source link

Ignore properties in equals / hascode #39

Closed cavarzan closed 8 years ago

cavarzan commented 8 years ago

Hi! It is possible to ignore a field in equals / hascode validation? I didn't find any annotation or configuration for this case.

LordRaydenMK commented 8 years ago

From the autovalue documentation:

Custom implementations

Don't like the equals, hashCode or toString method AutoValue generates? You can underride it! Just write your own, directly in your abstract class; AutoValue will see this and skip generating its own.

Derived fields

If a field exists to cache a derived value, and should be ignored in equals, hashCode and toString, define it directly in your class instead of providing an abstract accessor for it. AutoValue will know nothing of it.

You may have fields you wish to ignore in equals for other reasons. We're sorry: AutoValue doesn't work for these cases, since there's no way to pass the extra parameter "through" the generated class constructor.

cavarzan commented 8 years ago

@LordRaydenMK thanks!