Class Space

java.lang.Object
org.openrewrite.java.tree.Space

public class Space extends Object
Wherever whitespace can occur in Java, so can comments (at least block and javadoc style comments). So whitespace and comments are like peanut butter and jelly.
  • Field Details

    • EMPTY

      public static final Space EMPTY
  • Method Details

    • build

      public static Space build(@Nullable @Nullable String whitespace, List<Comment> comments)
    • getIndent

      public String getIndent()
    • getLastWhitespace

      public String getLastWhitespace()
    • getComments

      public List<Comment> getComments()
    • getWhitespace

      public String getWhitespace()
    • withComments

      public Space withComments(List<Comment> comments)
    • withWhitespace

      public Space withWhitespace(String whitespace)
    • isEmpty

      public boolean isEmpty()
    • firstPrefix

      public static Space firstPrefix(@Nullable @Nullable List<? extends J> trees)
    • format

      public static Space format(String formatting)
    • formatLastSuffix

      public static <J2 extends J> List<JRightPadded<J2>> formatLastSuffix(@Nullable @Nullable List<JRightPadded<J2>> trees, Space suffix)
    • formatFirstPrefix

      public static <J2 extends J> List<J2> formatFirstPrefix(List<J2> trees, Space prefix)
    • toString

      public String toString()
      Overrides:
      toString in class Object