Skip to content

Commit

Permalink
Add <br> and <div> methods to FormBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
Yong Sheng Tan committed Sep 3, 2019
1 parent a981218 commit 415b6eb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/java/utils/FormBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ public String formatElement() {
.build();
}

public FormBuilder addLineBreak() {
messageML.append(TagBuilder.builder("br").buildSelfClosing());
return this;
}

public FormBuilder addLineBreaks(int quantity) {
for (int i = 0; i < quantity; i++) {
messageML.append(TagBuilder.builder("br").buildSelfClosing());
}
return this;
}

public FormBuilder addDiv(String contents) {
messageML.append(TagBuilder.builder("div").setContents(contents).build());
return this;
}

public FormBuilder addHeader(int size, String text) {
if (size < 1 || size > 6) {
size = 6;
Expand Down

0 comments on commit 415b6eb

Please sign in to comment.