Annotation Interface NameWith
Often there is a requirement to get the names of different credentials in order to allow the user to select from
multiple equivalent credentials. With Java 8 defender methods we could add a default method to
Credentials
however given the Java requirements of Jenkins we do not have this luxury. In any case different types of credentials
will have different types of naming schemes, eg certificates vs username/password.
This annotation is applied to implementations or to marker interfaces. Where an implementation class is annotated, that annotation will always win, even if inherited. In the absence of the base class being annotated all the interfaces that the credential implements will be checked for the annotation. When checking multiple interfaces, the highest priority wins. The behaviour is indeterminate if there are multiple annotated interfaces with the same priority.
- Since:
- 1.7
-
Required Element Summary
Modifier and TypeRequired ElementDescriptionClass<? extends CredentialsNameProvider<? extends Credentials>>
The naming class to use. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionint
When forced to name via interfaces, the highest priority among all interfaces wins.
-
Element Details
-
value
The naming class to use.- Returns:
- The naming class to use.
-
-
-
priority
int priorityWhen forced to name via interfaces, the highest priority among all interfaces wins.- Returns:
- the priority among interface based providers.
- Default:
- 0
-