Class ToStringGenerator

java.lang.Object
me.bristermitten.mittenlib.annotations.config.ToStringGenerator

public class ToStringGenerator extends Object
Generates toString methods for configuration classes. This class creates a standard toString implementation that includes all properties of a configuration class in a readable format.
  • Constructor Details

    • ToStringGenerator

      @Inject public ToStringGenerator()
  • Method Details

    • generateToString

      @NotNull public @NotNull com.squareup.javapoet.MethodSpec generateToString(@NotNull @NotNull List<Property> properties, com.squareup.javapoet.ClassName className)
      Generates a toString method for a configuration class. The generated method returns a string representation of the class in the format: "ClassName{property1=value1, property2=value2, ...}"
      Parameters:
      properties - The list of properties to include in the toString method
      className - The name of the class for which the toString method is being generated
      Returns:
      A MethodSpec representing the generated toString method