Skip to content

Latest commit

 

History

History
48 lines (40 loc) · 1.14 KB

README.md

File metadata and controls

48 lines (40 loc) · 1.14 KB

Pretty Printer

Now! You can print anything in Java!

  • colorful printer
  • brackets of different depths have different colors
  • support date format
  • support plain object with getter/setter
  • support termination of infinite nested of objects
  • ...

Sample

// string:
Pretty.print("Hi there! This is Pretty-Printer!😉");
// boolean:
Pretty.print(false);
Pretty.print(true);
// number:
Pretty.print(1);
// null:
Pretty.print(null);
// list:
Pretty.print(Arrays.asList(1, 2, 3, 4, 5, 6));
// object:
User tom = new User("Tom", "https://io.youxingz/images/avatar_a.png", 17, 1.82f, "How is it going");
User john = new User("John", "https://io.youxingz/images/avatar_b.png", 18, 1.76f, "I am fine, thank you");
Friend friend = new Friend(tom, john);
Pretty.print(friend);
// list of objects:
Pretty.print(Arrays.asList(tom, tom, tom));

Console output:

img.png

Installation

<dependency>
    <groupId>io.pretty</groupId>
    <artifactId>pretty-printer</artifactId>
    <version>1.0.1</version>
</dependency>