mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-30 02:13:33 -04:00
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:
parent
3295662697
commit
73ad49ac51
15 changed files with 30 additions and 25 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -23,5 +23,5 @@ public @interface NamedComponent {
|
|||
* The name used for registration and lookup
|
||||
* @return a name
|
||||
*/
|
||||
String name();
|
||||
String value();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue