Annotation Type HashCodeAndEqualsPlugin.Enhance


  • @Documented
    @Target(TYPE)
    @Retention(RUNTIME)
    public static @interface HashCodeAndEqualsPlugin.Enhance
    Instructs the HashCodeAndEqualsPlugin to generate Object.hashCode() and Object.equals(Object) for the annotated class unless these methods are already declared explicitly.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean includeSyntheticFields
      Determines if synthetic fields should be included in the hash code and equality contract.
      HashCodeAndEqualsPlugin.Enhance.InvokeSuper invokeSuper
      Determines the base value of any added method, i.e.
      boolean permitSubclassEquality
      Determines if instances subclasses of the instrumented type are accepted upon an equality check.
      boolean simpleComparisonsFirst
      Determines if fields with primitive types, then enumeration types, then primtive wrapper types and then String types should be compared for equality before fields with other types.
    • 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 then String types should be compared for equality before fields with other types. Before determining such a field order, the HashCodeAndEqualsPlugin.Sorted property is always considered first if it is defined.
        Returns:
        true if fields with simple comparison methods should be compared first.
        Default:
        true
      • includeSyntheticFields

        boolean includeSyntheticFields
        Determines if synthetic fields should be included in the hash code and equality contract.
        Returns:
        true if synthetic fields should be included.
        Default:
        false
      • permitSubclassEquality

        boolean permitSubclassEquality
        Determines if instances subclasses of the instrumented type are accepted upon an equality check.
        Returns:
        true if instances subclasses of the instrumented type are accepted upon an equality check.
        Default:
        false