Class Border


  • public class Border
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Border.Builder  
    • Constructor Summary

      Constructors 
      Constructor Description
      Border​(Line first, Line last, Line header, Line inner, Line row, java.util.function.Function<java.lang.String,​java.lang.String> escape)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Border.Builder asciiCompact()
      Col1 Col2 Col3 Numeric Column ---------------------------------- --------- ------------------------ ---------------- Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell
      static Border.Builder asciiDots()
      ........................................................................................
      static Border.Builder asciiSeparated()
      +==================================+=========+========================+================+ | Col1 | Col2 | Col3 | Numeric Column | +==================================+=========+========================+================+ | Value 1 | Value 2 | 123 | 10.0 | +----------------------------------+---------+------------------------+----------------+ | Separate | cols | with a tab or 4 spaces | -2,027.1 | +----------------------------------+---------+------------------------+----------------+ | This is a row with only one cell | | | | +----------------------------------+---------+------------------------+----------------+
      static Border.Builder builder()  
      static Border.Builder csv()  
      java.lang.String escape​(java.lang.String value)  
      Line getFirst()  
      Line getHeader()  
      Line getInner()  
      Line getLast()  
      Line getRow()  
      java.lang.String getRowFormat​(java.util.List<Data.Column> columns)  
      Width getWidth​(int columns)  
      static Border.Builder githubMarkdown()
      | Col1 | Col2 | Col3 | Numeric Column | |----------------------------------|---------|------------------------|----------------| | Value 1 | Value 2 | 123 | 10.0 | | Separate | cols | with a tab or 4 spaces | -2,027.1 | | This is a row with only one cell | | | |
      static Border.Builder mysqlStyle()
      +----------------------------------+---------+------------------------+----------------+ | Col1 | Col2 | Col3 | Numeric Column | +----------------------------------+---------+------------------------+----------------+ | Value 1 | Value 2 | 123 | 10.0 | | Separate | cols | with a tab or 4 spaces | -2,027.1 | | This is a row with only one cell | | | | +----------------------------------+---------+------------------------+----------------+
      static Border.Builder redditMarkdown()
      Col1 | Col2 | Col3 | Numeric Column ----------------------------------|---------|------------------------|---------------- Value 1 | Value 2 | 123 | 10.0 Separate | cols | with a tab or 4 spaces | -2,027.1 This is a row with only one cell | | |
      static Border.Builder reStructuredTextGrid()
      +----------------------------------+---------+------------------------+----------------+ | Col1 | Col2 | Col3 | Numeric Column | +==================================+=========+========================+================+ | Value 1 | Value 2 | 123 | 10.0 | | Separate | cols | with a tab or 4 spaces | -2,027.1 | | This is a row with only one cell | | | | +----------------------------------+---------+------------------------+----------------+
      static Border.Builder reStructuredTextSimple()
      ================================== ========= ======================== ================ Col1 Col2 Col3 Numeric Column ================================== ========= ======================== ================ Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell ================================== ========= ======================== ================
      static Border.Builder tsv()  
      static Border.Builder unicodeDouble()
      ╔══════════════════════════════════╦═════════╦════════════════════════╦════════════════╗ ║ Col1 ║ Col2 ║ Col3 ║ Numeric Column ║ ╠══════════════════════════════════╬═════════╬════════════════════════╬════════════════╣ ║ Value 1 ║ Value 2 ║ 123 ║ 10.0 ║ ║ Separate ║ cols ║ with a tab or 4 spaces ║ -2,027.1 ║ ║ This is a row with only one cell ║ ║ ║ ║ ╚══════════════════════════════════╩═════════╩════════════════════════╩════════════════╝
      static Border.Builder unicodeSingle()
      ┌──────────────────────────────────┬─────────┬────────────────────────┬────────────────┐ │ Col1 │ Col2 │ Col3 │ Numeric Column │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ Value 1 │ Value 2 │ 123 │ 10.0 │ │ Separate │ cols │ with a tab or 4 spaces │ -2,027.1 │ │ This is a row with only one cell │ │ │ │ └──────────────────────────────────┴─────────┴────────────────────────┴────────────────┘
      static Border.Builder unicodeSingleSeparated()
      ┌──────────────────────────────────┬─────────┬────────────────────────┬────────────────┐ │ Col1 │ Col2 │ Col3 │ Numeric Column │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ Value 1 │ Value 2 │ 123 │ 10.0 │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ Separate │ cols │ with a tab or 4 spaces │ -2,027.1 │ ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤ │ This is a row with only one cell │ │ │ │ └──────────────────────────────────┴─────────┴────────────────────────┴────────────────┘
      static Border.Builder whitespaceCompact()
      Col1 Col2 Col3 Numeric Column Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell
      static Border.Builder whitespaceSeparated()
      Col1 Col2 Col3 Numeric Column Value 1 Value 2 123 10.0 Separate cols with a tab or 4 spaces -2,027.1 This is a row with only one cell
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Border

        public Border​(Line first,
                      Line last,
                      Line header,
                      Line inner,
                      Line row,
                      java.util.function.Function<java.lang.String,​java.lang.String> escape)
    • Method Detail

      • escape

        public java.lang.String escape​(java.lang.String value)
      • getRowFormat

        public java.lang.String getRowFormat​(java.util.List<Data.Column> columns)
      • getFirst

        public Line getFirst()
      • getLast

        public Line getLast()
      • getHeader

        public Line getHeader()
      • getInner

        public Line getInner()
      • getRow

        public Line getRow()
      • getWidth

        public Width getWidth​(int columns)
      • whitespaceSeparated

        public static Border.Builder whitespaceSeparated()
                        Col1                  Col2              Col3            Numeric Column
        
          Value 1                            Value 2   123                                10.0
        
          Separate                           cols      with a tab or 4 spaces         -2,027.1
        
          This is a row with only one cell
         
      • whitespaceCompact

        public static Border.Builder whitespaceCompact()
                        Col1                  Col2              Col3            Numeric Column
        
          Value 1                            Value 2   123                                10.0
          Separate                           cols      with a tab or 4 spaces         -2,027.1
          This is a row with only one cell
         
      • mysqlStyle

        public static Border.Builder mysqlStyle()
         +----------------------------------+---------+------------------------+----------------+
         |               Col1               |  Col2   |          Col3          | Numeric Column |
         +----------------------------------+---------+------------------------+----------------+
         | Value 1                          | Value 2 | 123                    |           10.0 |
         | Separate                         | cols    | with a tab or 4 spaces |       -2,027.1 |
         | This is a row with only one cell |         |                        |                |
         +----------------------------------+---------+------------------------+----------------+
         
      • asciiSeparated

        public static Border.Builder asciiSeparated()
         +==================================+=========+========================+================+
         |               Col1               |  Col2   |          Col3          | Numeric Column |
         +==================================+=========+========================+================+
         | Value 1                          | Value 2 | 123                    |           10.0 |
         +----------------------------------+---------+------------------------+----------------+
         | Separate                         | cols    | with a tab or 4 spaces |       -2,027.1 |
         +----------------------------------+---------+------------------------+----------------+
         | This is a row with only one cell |         |                        |                |
         +----------------------------------+---------+------------------------+----------------+
         
      • asciiCompact

        public static Border.Builder asciiCompact()
                         Col1                  Col2              Col3            Numeric Column
          ---------------------------------- --------- ------------------------ ----------------
           Value 1                            Value 2   123                                10.0
           Separate                           cols      with a tab or 4 spaces         -2,027.1
           This is a row with only one cell
         
      • githubMarkdown

        public static Border.Builder githubMarkdown()
         |               Col1               |  Col2   |          Col3          | Numeric Column |
         |----------------------------------|---------|------------------------|----------------|
         | Value 1                          | Value 2 | 123                    |           10.0 |
         | Separate                         | cols    | with a tab or 4 spaces |       -2,027.1 |
         | This is a row with only one cell |         |                        |                |
         
      • redditMarkdown

        public static Border.Builder redditMarkdown()
                         Col1               |  Col2   |          Col3          | Numeric Column
          ----------------------------------|---------|------------------------|----------------
           Value 1                          | Value 2 | 123                    |           10.0
           Separate                         | cols    | with a tab or 4 spaces |       -2,027.1
           This is a row with only one cell |         |                        |
         
      • reStructuredTextGrid

        public static Border.Builder reStructuredTextGrid()
         +----------------------------------+---------+------------------------+----------------+
         |               Col1               |  Col2   |          Col3          | Numeric Column |
         +==================================+=========+========================+================+
         | Value 1                          | Value 2 | 123                    |           10.0 |
         | Separate                         | cols    | with a tab or 4 spaces |       -2,027.1 |
         | This is a row with only one cell |         |                        |                |
         +----------------------------------+---------+------------------------+----------------+
         
      • reStructuredTextSimple

        public static Border.Builder reStructuredTextSimple()
          ================================== ========= ======================== ================
                         Col1                  Col2              Col3            Numeric Column
          ================================== ========= ======================== ================
           Value 1                            Value 2   123                                10.0
           Separate                           cols      with a tab or 4 spaces         -2,027.1
           This is a row with only one cell
          ================================== ========= ======================== ================
         
      • asciiDots

        public static Border.Builder asciiDots()
         ........................................................................................
         :               Col1               :  Col2   :          Col3          : Numeric Column :
         :..................................:.........:........................:................:
         : Value 1                          : Value 2 : 123                    :           10.0 :
         : Separate                         : cols    : with a tab or 4 spaces :       -2,027.1 :
         : This is a row with only one cell :         :                        :                :
         :..................................:.........:........................:................:
         
      • unicodeDouble

        public static Border.Builder unicodeDouble()
         ╔══════════════════════════════════╦═════════╦════════════════════════╦════════════════╗
         ║               Col1               ║  Col2   ║          Col3          ║ Numeric Column ║
         ╠══════════════════════════════════╬═════════╬════════════════════════╬════════════════╣
         ║ Value 1                          ║ Value 2 ║ 123                    ║           10.0 ║
         ║ Separate                         ║ cols    ║ with a tab or 4 spaces ║       -2,027.1 ║
         ║ This is a row with only one cell ║         ║                        ║                ║
         ╚══════════════════════════════════╩═════════╩════════════════════════╩════════════════╝
         
      • unicodeSingle

        public static Border.Builder unicodeSingle()
         ┌──────────────────────────────────┬─────────┬────────────────────────┬────────────────┐
         │               Col1               │  Col2   │          Col3          │ Numeric Column │
         ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤
         │ Value 1                          │ Value 2 │ 123                    │           10.0 │
         │ Separate                         │ cols    │ with a tab or 4 spaces │       -2,027.1 │
         │ This is a row with only one cell │         │                        │                │
         └──────────────────────────────────┴─────────┴────────────────────────┴────────────────┘
         
      • unicodeSingleSeparated

        public static Border.Builder unicodeSingleSeparated()
         ┌──────────────────────────────────┬─────────┬────────────────────────┬────────────────┐
         │               Col1               │  Col2   │          Col3          │ Numeric Column │
         ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤
         │ Value 1                          │ Value 2 │ 123                    │           10.0 │
         ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤
         │ Separate                         │ cols    │ with a tab or 4 spaces │       -2,027.1 │
         ├──────────────────────────────────┼─────────┼────────────────────────┼────────────────┤
         │ This is a row with only one cell │         │                        │                │
         └──────────────────────────────────┴─────────┴────────────────────────┴────────────────┘