Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danilodeluca/linebuilder
Its a simple way to create lines, when you need to set variables in certain "index of the line", easy to use. Feel free to open issues and request a PR!!
https://github.com/danilodeluca/linebuilder
Last synced: 7 days ago
JSON representation
Its a simple way to create lines, when you need to set variables in certain "index of the line", easy to use. Feel free to open issues and request a PR!!
- Host: GitHub
- URL: https://github.com/danilodeluca/linebuilder
- Owner: danilodeLuca
- Created: 2015-09-10T23:47:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-13T15:25:15.000Z (about 7 years ago)
- Last Synced: 2024-12-12T20:37:56.916Z (22 days ago)
- Language: Java
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A simple linebuilder.
Checkout tests to see how it works, its not difficult!!
## Example:
1. Simple line with 1 column and 4 lenght character``` java
String build = new LineBuilder(4)
.column("test").at(1, 4).value("test")
.build();
```
Result:
``` java
Assert.assertEquals("test", build);
```2. Line with 2 columns and 9 lenght character
``` java
String build = new LineBuilder(9)
.column("test").at(1, 4).value("test")
.column("test2").at(5, 9).value("test2")
.build();
```
Result:
``` java
Assert.assertEquals("testtest2", build);
```
3. Line with 1 columns and 4 lenght character and defined a complementer to left that will not be used
``` java
String build = new LineBuilder(4)
.complementColumn(Complementer.onLeft("|"))
.column("test").at(1, 4).value("test")
.build();
```
Result:
``` java
Assert.assertEquals("test", build);
```
4. Line with 1 columns and 5 lenght character and defined a complementer to left that will be used
``` java
String build = new LineBuilder(5)
.complementColumn(Complementer.onLeft("|"))
.column("test").at(1, 5).value("test")
.build();
```
Result:
``` java
Assert.assertEquals("|test", build);
```5. Line with 1 columns and 5 lenght character and defined a complementer to right that will be used
``` java
String build = new LineBuilder(5)
.complementColumn(Complementer.onRight("|"))
.column("test").at(1, 5).value("test")
.build();
```
Result:
``` java
Assert.assertEquals("test|", build);
```