Package net.bytebuddy.build
Annotation Type HashCodeAndEqualsPlugin.Enhance
-
@Documented @Target(TYPE) @Retention(RUNTIME) public static @interface HashCodeAndEqualsPlugin.EnhanceInstructs theHashCodeAndEqualsPluginto generateObject.hashCode()andObject.equals(Object)for the annotated class unless these methods are already declared explicitly.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanincludeSyntheticFieldsDetermines if synthetic fields should be included in the hash code and equality contract.HashCodeAndEqualsPlugin.Enhance.InvokeSuperinvokeSuperDetermines the base value of any added method, i.e.booleanpermitSubclassEqualityDetermines if instances subclasses of the instrumented type are accepted upon an equality check.booleansimpleComparisonsFirstDetermines if fields with primitive types, then enumeration types, then primtive wrapper types and thenStringtypes should be compared for equality before fields with other types.booleanuseTypeHashConstantDetermines if the hash code constant should be derived of the instrumented type.
-
-
-
Element Detail
-
invokeSuper
HashCodeAndEqualsPlugin.Enhance.InvokeSuper invokeSuper
Determines the base value of any added method, i.e. if hash code or equality is based on the super type or not.- Returns:
- A strategy for determining the base value.
- Default:
- net.bytebuddy.build.HashCodeAndEqualsPlugin.Enhance.InvokeSuper.IF_DECLARED
-
-
-
simpleComparisonsFirst
boolean simpleComparisonsFirst
Determines if fields with primitive types, then enumeration types, then primtive wrapper types and thenStringtypes should be compared for equality before fields with other types. Before determining such a field order, theHashCodeAndEqualsPlugin.Sortedproperty is always considered first if it is defined.- Returns:
trueif fields with simple comparison methods should be compared first.
- Default:
- true
-
-
-
useTypeHashConstant
boolean useTypeHashConstant
Determines if the hash code constant should be derived of the instrumented type. IfpermitSubclassEquality()is set totrue, this constant is derived of the declared class, otherwise the type hash is computed of the active instance.- Returns:
trueif the hash code constant should be derived of the instrumented type.
- Default:
- true
-
-