惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
T
Threatpost
N
News and Events Feed by Topic
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
D
Docker
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
T
Troy Hunt's Blog
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
量子位
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
F
Full Disclosure
B
Blog
O
OpenAI News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
Forbes - Security
Forbes - Security
Know Your Adversary
Know Your Adversary
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
Scott Helme
Scott Helme
T
The Exploit Database - CXSecurity.com
博客园 - 聂微东
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
Recorded Future
Recorded Future
IT之家
IT之家
Project Zero
Project Zero
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
SecWiki News
SecWiki News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

闪烁之狐

Fenix — 比 MyBatis 更加强大的 Spring Data JPA 扩展库 SpringBoot2.x 单元测试 | 闪烁之狐 Java代码性能评估库Stalker介绍 | 闪烁之狐 Java面向对象设计之桥接模式 | 闪烁之狐 Java面向对象设计之适配器模式 | 闪烁之狐 软件程序设计原则 | 闪烁之狐 GitLab CI/CD 介绍和使用 | 闪烁之狐 Vue 文档风格的 Typora 主题 | 闪烁之狐 CPU多级缓存 | 闪烁之狐 单元测试指南 | 闪烁之狐 Java8新特性及使用(二) | 闪烁之狐 Java8新特性及使用(一) | 闪烁之狐 Java7新特性及使用 | 闪烁之狐 Java6新特性及使用 | 闪烁之狐 Java5新特性及使用 | 闪烁之狐 Java注解的理解和应用 | 闪烁之狐 Java反射基础 | 闪烁之狐 Java IO 知识整理 | 闪烁之狐 Java面向对象设计之责任链模式 | 闪烁之狐
一个极简的 Java ASCII 表格生成库 | 闪烁之狐
文章作者: blinkfox · 2019-01-25 · via 闪烁之狐

一个轻量级、零依赖的 Java ASCII 表格生成库。

特性

  • 轻量级、无依赖(jar包仅9kb
  • API简单易用
  • 易于集成或定制修改,仅一个Java文件,且代码规范

集成使用

Maven集成

<dependency>
    <groupId>com.blinkfox</groupId>
    <artifactId>mini-table</artifactId>
    <version>1.0.0</version>
</dependency>

API 使用

示例1(无标题)

String table = new MiniTable()
        .addHeaders("header1", "header2")
        .addDatas("col11", "col12")
        .addDatas("col21", "col22")
        .render();
System.out.println(table);

输出结果:

+---------+---------+
| header1 | header2 |
+---------+---------+
|  col11  |  col12  |
|  col21  |  col22  |
+---------+---------+

示例2(有标题)

String table = new MiniTable("The Title")
        .addHeaders("Name", "Sex", "Age", "Email", "Phone")
        .addDatas("LiLei", "male", 25, "lilei@gmail.com", "13809345219")
        .addDatas("hanMeiMei", "female", 23, "hmm@163.com", "13515343853")
        .addDatas("ZhangSan", "female", 32, "zhangsan@gmail.com", "13920199836")
        .render();
System.out.println(table);

输出结果:

+-------------------------------------------------------------+
|                          The Title                          |
+-----------+--------+-----+--------------------+-------------+
|   Name    |  Sex   | Age |       Email        |    Phone    |
+-----------+--------+-----+--------------------+-------------+
|   LiLei   |  male  | 25  |  lilei@gmail.com   | 13809345219 |
| hanMeiMei | female | 23  |    hmm@163.com     | 13515343853 |
| ZhangSan  | female | 32  | zhangsan@gmail.com | 13920199836 |
+-----------+--------+-----+--------------------+-------------+

许可证

mini-table 类库遵守 Apache License 2.0 许可证。