From a9fcef4ad539d615df518f9e3422634c517ee5a0 Mon Sep 17 00:00:00 2001 From: Artur Date: Mon, 2 Sep 2024 14:01:13 +0300 Subject: [PATCH] chore: Make endpoint data available to copilot (#2689) Co-authored-by: Luciano Vernaschi Co-authored-by: Anton Platonov --- .../com/vaadin/hilla/EndpointRegistry.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/java/endpoint/src/main/java/com/vaadin/hilla/EndpointRegistry.java b/packages/java/endpoint/src/main/java/com/vaadin/hilla/EndpointRegistry.java index ccbc60e20d..9102d96b62 100644 --- a/packages/java/endpoint/src/main/java/com/vaadin/hilla/EndpointRegistry.java +++ b/packages/java/endpoint/src/main/java/com/vaadin/hilla/EndpointRegistry.java @@ -54,6 +54,15 @@ private VaadinEndpointData(Object vaadinEndpointObject, method)); } + /** + * Gets all the endpoint methods. + * + * @return the endpoint methods + */ + public Map getMethods() { + return methods; + } + /** * Finds a method with the given name. * @@ -126,6 +135,15 @@ void registerEndpoint(Object endpointBean) { beanType); } + /** + * Gets all registered endpoints. + * + * @return a map of endpoint names to endpoint data + */ + public Map getEndpoints() { + return vaadinEndpoints; + } + VaadinEndpointData get(String endpointName) { return vaadinEndpoints.get(endpointName.toLowerCase(Locale.ENGLISH)); }