Enum CachedReturnPlugin.AdviceResolver

java.lang.Object
java.lang.Enum<CachedReturnPlugin.AdviceResolver>
net.bytebuddy.build.CachedReturnPlugin.AdviceResolver
All Implemented Interfaces:
Serializable, Comparable<CachedReturnPlugin.AdviceResolver>, java.lang.constant.Constable
Enclosing class:
CachedReturnPlugin

protected static enum CachedReturnPlugin.AdviceResolver extends Enum<CachedReturnPlugin.AdviceResolver>
A resolver for Advice that caches a method's return type.
  • Enum Constant Details

  • Field Details

    • dynamicType

      private final DynamicType dynamicType
      The created dynamic type to use for advice.
  • Constructor Details

    • AdviceResolver

      private AdviceResolver(Class<?> type, int load, int store, int convert, int branch)
      Creates an advice resolver.
      Parameters:
      type - The type of the return type.
      load - The byte code that loads a value onto the stack from the local variable array.
      store - The byte code that stores a value to the local variable array.
      convert - An instruction to convert the cached value to a value that is applied on the branch instruction.
      branch - A jump instruction that checks if the cached value is already set.
  • Method Details

    • values

      public static CachedReturnPlugin.AdviceResolver[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static CachedReturnPlugin.AdviceResolver valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      protected static CachedReturnPlugin.AdviceResolver of(TypeDefinition typeDefinition)
      Creates an advice resolver for a given type definition.
      Parameters:
      typeDefinition - The type definition for which advice is to be created.
      Returns:
      An appropriate advice resolver.
    • toAdvice

      protected Advice toAdvice(String name)
      Resolve advice for a given field name.
      Parameters:
      name - The name of the field to resolve the advice for.
      Returns:
      An appropriate advice.