Package net.bytebuddy.build
Enum Class HashCodeAndEqualsPlugin.Enhance.InvokeSuper
java.lang.Object
java.lang.Enum<HashCodeAndEqualsPlugin.Enhance.InvokeSuper>
net.bytebuddy.build.HashCodeAndEqualsPlugin.Enhance.InvokeSuper
- All Implemented Interfaces:
Serializable
,Comparable<HashCodeAndEqualsPlugin.Enhance.InvokeSuper>
,Constable
- Enclosing class:
HashCodeAndEqualsPlugin.Enhance
public static enum HashCodeAndEqualsPlugin.Enhance.InvokeSuper
extends Enum<HashCodeAndEqualsPlugin.Enhance.InvokeSuper>
A strategy for determining the base value of a hash code or equality contract.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAlways invokes the super class's hash code and equality methods.Only invokes the super method's hash code and equality methods if the super class is also annotated withHashCodeAndEqualsPlugin.Enhance
.Only invokes the super method's hash code and equality methods if any super class that is notObject
explicitly defines such a method.Never invokes the super class's hash code and equality methods. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract EqualsMethod
equalsMethod
(TypeDescription instrumentedType) Resolves the equals method to use.protected abstract HashCodeMethod
hashCodeMethod
(TypeDescription instrumentedType, boolean typeHash, boolean subclassEquality) Resolves the hash code method to use.Returns the enum constant of this class with the specified name.values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
IF_DECLARED
Only invokes the super method's hash code and equality methods if any super class that is notObject
explicitly defines such a method. -
IF_ANNOTATED
Only invokes the super method's hash code and equality methods if the super class is also annotated withHashCodeAndEqualsPlugin.Enhance
. -
ALWAYS
Always invokes the super class's hash code and equality methods. -
NEVER
Never invokes the super class's hash code and equality methods.
-
-
Constructor Details
-
InvokeSuper
private InvokeSuper()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
hashCodeMethod
protected abstract HashCodeMethod hashCodeMethod(TypeDescription instrumentedType, boolean typeHash, boolean subclassEquality) Resolves the hash code method to use.- Parameters:
instrumentedType
- The instrumented type.typeHash
-true
if the base hash should be based on the instrumented class's type.subclassEquality
-true
if subclasses can be equal to their base classes.- Returns:
- The hash code method to use.
-
equalsMethod
Resolves the equals method to use.- Parameters:
instrumentedType
- The instrumented type.- Returns:
- The equals method to use.
-