From c37900c02988859064c1de6766e170d12837565e Mon Sep 17 00:00:00 2001 From: Marco Kaufmann Date: Wed, 22 Jan 2025 13:20:26 +0100 Subject: [PATCH] Refined API in NewFileSliceGraph --- .../sensor/architecture/NewFileSliceGraph.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugin-api/src/main/java/org/sonar/api/batch/sensor/architecture/NewFileSliceGraph.java b/plugin-api/src/main/java/org/sonar/api/batch/sensor/architecture/NewFileSliceGraph.java index eeae958b..dd14ec37 100644 --- a/plugin-api/src/main/java/org/sonar/api/batch/sensor/architecture/NewFileSliceGraph.java +++ b/plugin-api/src/main/java/org/sonar/api/batch/sensor/architecture/NewFileSliceGraph.java @@ -26,11 +26,22 @@ */ public interface NewFileSliceGraph { + /** + * Sets the source code language for which this file slice graph was recorded. + * + * @param language source code language (`java`, `javascript`, ...) + */ + @Beta + NewFileSliceGraph setLanguage(String language); + /** * Sets the graph data for this file slice graph from the given byte array. + * This method is for internal use only. + * The concrete data format is not nearer specified while prone to change in the future, it is irrelevant for the DB side. + * There must be a common contract between the analyzer side and the UI side. * * @param bytes graph data */ @Beta - void setGraphData(byte[] bytes); + NewFileSliceGraph setData(byte[] bytes); }