Class AnnotationDescription.AnnotationInvocationHandler<T extends Annotation>

java.lang.Object
net.bytebuddy.description.annotation.AnnotationDescription.AnnotationInvocationHandler<T>
Type Parameters:
T - The type of the handled annotation.
All Implemented Interfaces:
InvocationHandler
Enclosing interface:
AnnotationDescription

public static class AnnotationDescription.AnnotationInvocationHandler<T extends Annotation> extends Object implements InvocationHandler
An InvocationHandler for implementing annotations.
  • Field Details

  • Constructor Details

    • AnnotationInvocationHandler

      protected AnnotationInvocationHandler(Class<T> annotationType, LinkedHashMap<Method,AnnotationValue.Loaded<?>> values)
      Creates a new invocation handler.
      Parameters:
      annotationType - The loaded annotation type.
      values - A sorted list of values of this annotation.
  • Method Details

    • of

      public static <S extends Annotation> S of(@MaybeNull ClassLoader classLoader, Class<S> annotationType, Map<String,? extends AnnotationValue<?,?>> values)
      Creates a proxy instance for the supplied annotation type and values.
      Type Parameters:
      S - The type of the handled annotation.
      Parameters:
      classLoader - The class loader that should be used for loading the annotation's values.
      annotationType - The annotation's type.
      values - The values that the annotation contains.
      Returns:
      A proxy for the annotation type and values.
    • invoke

      public Object invoke(Object proxy, Method method, @MaybeNull Object[] argument)
      Specified by:
      invoke in interface InvocationHandler
    • toStringRepresentation

      protected String toStringRepresentation()
      Returns the string representation of the represented annotation.
      Returns:
      The string representation of the represented annotation.
    • hashCodeRepresentation

      private int hashCodeRepresentation()
      Returns the hash code of the represented annotation.
      Returns:
      The hash code of the represented annotation.
    • equalsRepresentation

      private boolean equalsRepresentation(Object self, Object other)
      Checks if another instance is equal to this instance.
      Parameters:
      self - The annotation proxy instance.
      other - The instance to be examined for equality to the represented instance.
      Returns:
      true if the given instance is equal to the represented instance.
    • hashCode

      @Enhance("hashCode") public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@MaybeNull Object other)
      Overrides:
      equals in class Object