Class Space

  • All Implemented Interfaces:
    org.openrewrite.marker.Markable

    public class Space
    extends java.lang.Object
    implements org.openrewrite.marker.Markable
    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 Detail

      • EMPTY

        public static final Space EMPTY
    • Method Detail

      • build

        public static Space build​(@Nullable
                                  @Nullable java.lang.String whitespace,
                                  java.util.List<Comment> comments,
                                  org.openrewrite.marker.Markers markers)
      • getIndent

        public java.lang.String getIndent()
      • getLastWhitespace

        public java.lang.String getLastWhitespace()
      • getComments

        public java.util.List<Comment> getComments()
      • getWhitespace

        public java.lang.String getWhitespace()
      • getMarkers

        public org.openrewrite.marker.Markers getMarkers()
        Specified by:
        getMarkers in interface org.openrewrite.marker.Markable
      • withMarkers

        public Space withMarkers​(org.openrewrite.marker.Markers markers)
        Specified by:
        withMarkers in interface org.openrewrite.marker.Markable
      • withComments

        public Space withComments​(java.util.List<Comment> comments)
      • withWhitespace

        public Space withWhitespace​(java.lang.String whitespace)
      • isEmpty

        public boolean isEmpty()
      • firstPrefix

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

        public static Space format​(java.lang.String formatting)
      • formatLastSuffix

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object