Rename NamedComponent name parameter to value (#91306)

to allow @NamedComponent("name") syntax java annotation should have single value annotation

relates #88980
This commit is contained in:
Przemyslaw Gomulka 2022-11-04 14:20:44 +01:00 committed by GitHub
parent 3295662697
commit 73ad49ac51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 30 additions and 25 deletions

View file

@ -22,7 +22,7 @@ public interface Nameable {
default String name() {
NamedComponent[] annotationsByType = this.getClass().getAnnotationsByType(NamedComponent.class);
if (annotationsByType.length == 1) {
return annotationsByType[0].name();
return annotationsByType[0].value();
}
return null;
}

View file

@ -23,5 +23,5 @@ public @interface NamedComponent {
* The name used for registration and lookup
* @return a name
*/
String name();
String value();
}