java.lang.Object
dev.langchain4j.image_to_diagram.actions.correction.PlantUMLAction

public class PlantUMLAction extends Object
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`.
  • Constructor Details

    • PlantUMLAction

      public PlantUMLAction()
  • Method Details

    • validate

      public static <T> CompletableFuture<T> validate(String code)
      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

      public static <T> CompletableFuture<T> validateWithSingleLineError(String code)
      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