Class PlantUMLAction
java.lang.Object
dev.langchain4j.image_to_diagram.actions.correction.PlantUMLAction
The `PlantUMLAction` class provides utility methods for validating PlantUML code.
It includes nested classes and static methods to handle the validation of PlantUML code blocks,
extracting errors if any, and returning results in a `CompletableFuture`.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents an error that occurred during the PlantUML code processing. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CompletableFuture<T>
Validates PlantUML code and returns a `CompletableFuture`.static <T> CompletableFuture<T>
Validates PlantUML code with a single line error and returns a `CompletableFuture`.
-
Constructor Details
-
PlantUMLAction
public PlantUMLAction()
-
-
Method Details
-
validate
Validates PlantUML code and returns a `CompletableFuture`. This method takes a string containing PlantUML code, processes it, and completes the future exceptionally if an error is found.- Type Parameters:
T
- the type of the result- Parameters:
code
- the PlantUML code to validate- Returns:
- a `CompletableFuture` that will contain the result or error
-
validateWithSingleLineError
Validates PlantUML code with a single line error and returns a `CompletableFuture`. This method takes a string containing PlantUML code, processes it, and completes the future exceptionally if an error is found, formatted as a single-line error message.- Type Parameters:
T
- the type of the result- Parameters:
code
- the PlantUML code to validate- Returns:
- a `CompletableFuture` that will contain the result or error
-