Interface CodeBlock.FormattingOptions

Enclosing class:
CodeBlock

public static interface CodeBlock.FormattingOptions
Strategy interface to customize formatting of generated code block.
  • Method Details

    • statementSeparator

      String statementSeparator()
      Return the separator to use to end a statement.
      Returns:
      the statement separator
    • arrayOf

      CodeBlock arrayOf(CodeBlock... values)
      Return the code that represents an array for the specified values.
      Parameters:
      values - the values of the array
      Returns:
      an array defining the specified values
    • classReference

      CodeBlock classReference(ClassName className)
      Return the code that represents a reference to the specified ClassName. For instance with java, a reference to com.example.Test would be Test.class.
      Parameters:
      className - the class name to handle
      Returns:
      a class reference to the specified class name