forked from Fascinated/Bat
impl a EmbedDescriptionBuilder
This commit is contained in:
@ -0,0 +1,40 @@
|
||||
package cc.fascinated.bat.common;
|
||||
|
||||
import lombok.NonNull;
|
||||
|
||||
/**
|
||||
* @author Fascinated (fascinated7)
|
||||
*/
|
||||
public class EmbedDescriptionBuilder {
|
||||
/**
|
||||
* Where the description is stored
|
||||
*/
|
||||
private final StringBuilder builder = new StringBuilder();
|
||||
|
||||
public EmbedDescriptionBuilder(String title) {
|
||||
builder.append("**").append(title).append("**").append("\n");
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public EmbedDescriptionBuilder appendLine(@NonNull String line, boolean arrow) {
|
||||
builder.append(arrow ? "➜ " : "").append(line).append("\n");
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public EmbedDescriptionBuilder appendSubtitle(@NonNull String title) {
|
||||
builder.append("**").append(title).append("**").append("\n");
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public EmbedDescriptionBuilder emptyLine() {
|
||||
builder.append("\n");
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String build() {
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user