Package net.bytebuddy.asm
Enum Class MemberSubstitution.Substitution.Stubbing
java.lang.Object
java.lang.Enum<MemberSubstitution.Substitution.Stubbing>
net.bytebuddy.asm.MemberSubstitution.Substitution.Stubbing
- All Implemented Interfaces:
Serializable
,Comparable<MemberSubstitution.Substitution.Stubbing>
,Constable
,MemberSubstitution.Substitution
,MemberSubstitution.Substitution.Factory
- Enclosing interface:
- MemberSubstitution.Substitution
public static enum MemberSubstitution.Substitution.Stubbing
extends Enum<MemberSubstitution.Substitution.Stubbing>
implements MemberSubstitution.Substitution, MemberSubstitution.Substitution.Factory
A substitution that drops any field or method access and returns the expected return type's default value, i.e
null
or zero for primitive types.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Substitution
MemberSubstitution.Substitution.Chain, MemberSubstitution.Substitution.Factory, MemberSubstitution.Substitution.ForFieldAccess, MemberSubstitution.Substitution.ForMethodInvocation, MemberSubstitution.Substitution.Stubbing
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmake
(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypePool typePool) Creates a substitution for an instrumented method.resolve
(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result, int freeOffset) Resolves this substitution into a stack manipulation.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
-
INSTANCE
The singleton instance.
-
-
Constructor Details
-
Stubbing
private Stubbing()
-
-
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
-
make
public MemberSubstitution.Substitution make(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypePool typePool) Creates a substitution for an instrumented method.- Specified by:
make
in interfaceMemberSubstitution.Substitution.Factory
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.typePool
- The type pool being used.- Returns:
- The substitution to apply within the instrumented method.
-
resolve
public StackManipulation resolve(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result, int freeOffset) Resolves this substitution into a stack manipulation.- Specified by:
resolve
in interfaceMemberSubstitution.Substitution
- Parameters:
targetType
- The target type on which a member is accessed.target
- The target field, method or constructor that is substituted,parameters
- All parameters that serve as input to this access.result
- The result that is expected from the interaction orvoid
if no result is expected.freeOffset
- The first free offset of the local variable array that can be used for storing values.- Returns:
- A stack manipulation that represents the access.
-