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.
  • Enum Constant Details

  • Constructor Details

    • Stubbing

      private Stubbing()
  • Method Details

    • values

      public static MemberSubstitution.Substitution.Stubbing[] 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

      public static MemberSubstitution.Substitution.Stubbing valueOf(String name)
      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 name
      NullPointerException - 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 interface MemberSubstitution.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 interface MemberSubstitution.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 or void 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.