Top Description Inners Fields Methods
net.bytebuddy.implementation.bind.annotation

public @Interface BindingPriority

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:METHOD
Imports
net.bytebuddy.description.annotation.AnnotationDescription, net.bytebuddy.description.method.MethodDescription, net.bytebuddy.description.type.TypeDescription, net.bytebuddy.implementation.bind.MethodDelegationBinder, net.bytebuddy.utility.nullability.MaybeNull, java.lang.annotation.*

Defines a binding priority for a target method. If two target methods can be bound to a source method, the one with the higher priority will be selected.
See Also
net.bytebuddy.implementation.MethodDelegation, net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
BindingPriority.Resolver

An ambiguity resolver that considers the priority of a method as defined by the net.bytebuddy.implementation.bind.annotation.BindingPriority annotation.

Field Summary

Modifier and TypeField and Description
public static final int
DEFAULT

The default priority for methods not carrying the net.bytebuddy.implementation.bind.annotation.BindingPriority annotation.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The priority for the annotated method.
value
()

The binding priority for the annotated method.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Field Detail

DEFAULTback to summary
public static final int DEFAULT

The default priority for methods not carrying the net.bytebuddy.implementation.bind.annotation.BindingPriority annotation.

Method Detail

valueback to summary
public int value()

The binding priority for the annotated method. A method of higher priority will be preferred over a method of lower priority.

Returns:int

The priority for the annotated method.

net.bytebuddy.implementation.bind.annotation back to summary

public final Enum BindingPriority.Resolver

extends Enum<BindingPriority.Resolver>
implements AmbiguityResolver
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver

An ambiguity resolver that considers the priority of a method as defined by the net.bytebuddy.implementation.bind.annotation.BindingPriority annotation.

Field Summary

Modifier and TypeField and Description
public static final BindingPriority.Resolver
INSTANCE

The singleton instance.

private static final MethodDescription.InDefinedShape
VALUE

A description of the BindingPriority#value() method.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static int

Returns:

The factual priority of the method under investigation.
resolve
(AnnotationDescription.Loadable<BindingPriority>
The annotation of the method or null if no such annotation was found.
bindingPriority
)

Resolves the explicitly stated binding priority of a method or returns the default value if no such explicit information can be found.

public MethodDelegationBinder.AmbiguityResolver.Resolution
resolve(MethodDescription
The source method that was bound to both target methods.
source
,
MethodDelegationBinder.MethodBinding
The first successful binding of the source method.
left
,
MethodDelegationBinder.MethodBinding
The second successful binding of the source method.
right
)

Implements net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver.resolve.

Attempts to resolve to conflicting bindings.
public static BindingPriority.Resolver
public static BindingPriority.Resolver[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INSTANCEback to summary
public static final BindingPriority.Resolver INSTANCE

The singleton instance.

VALUEback to summary
private static final MethodDescription.InDefinedShape VALUE

A description of the BindingPriority#value() method.

Constructor Detail

Resolverback to summary
private Resolver()

Method Detail

resolveback to summary
private static int resolve(AnnotationDescription.Loadable<BindingPriority> bindingPriority)

Resolves the explicitly stated binding priority of a method or returns the default value if no such explicit information can be found.

Parameters
bindingPriority:AnnotationDescription.Loadable<BindingPriority>

The annotation of the method or null if no such annotation was found.

Returns:int

The factual priority of the method under investigation.

resolveback to summary
public MethodDelegationBinder.AmbiguityResolver.Resolution resolve(MethodDescription source, MethodDelegationBinder.MethodBinding left, MethodDelegationBinder.MethodBinding right)

Implements net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver.resolve.

Doc from net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver.resolve.

Attempts to resolve to conflicting bindings.

Parameters
source:MethodDescription

The source method that was bound to both target methods.

left:MethodDelegationBinder.MethodBinding

The first successful binding of the source method.

right:MethodDelegationBinder.MethodBinding

The second successful binding of the source method.

Returns:MethodDelegationBinder.AmbiguityResolver.Resolution

The resolution state when resolving a conflicting binding where net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver.Resolution#LEFT indicates a successful binding to the left binding while net.bytebuddy.implementation.bind.MethodDelegationBinder.AmbiguityResolver.Resolution#RIGHT indicates a successful binding to the right binding.

valueOfback to summary
public static BindingPriority.Resolver valueOf(String name)
valuesback to summary
public static BindingPriority.Resolver[] values()