2024-07-02 01:51:13 +01:00
|
|
|
package cc.fascinated.bat.common;
|
|
|
|
|
|
|
|
import lombok.NonNull;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Fascinated (fascinated7)
|
|
|
|
*/
|
2024-07-09 19:46:48 +01:00
|
|
|
public class DescriptionBuilder {
|
2024-07-02 01:51:13 +01:00
|
|
|
/**
|
|
|
|
* Where the description is stored
|
|
|
|
*/
|
|
|
|
private final StringBuilder builder = new StringBuilder();
|
|
|
|
|
2024-07-09 19:46:48 +01:00
|
|
|
public DescriptionBuilder(String title) {
|
2024-07-04 05:48:20 +01:00
|
|
|
if (title == null) {
|
|
|
|
return;
|
|
|
|
}
|
2024-07-02 01:51:13 +01:00
|
|
|
builder.append("**").append(title).append("**").append("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
2024-07-09 19:46:48 +01:00
|
|
|
public DescriptionBuilder appendLine(@NonNull String line, boolean arrow) {
|
2024-07-02 01:51:13 +01:00
|
|
|
builder.append(arrow ? "➜ " : "").append(line).append("\n");
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
2024-07-09 19:46:48 +01:00
|
|
|
public DescriptionBuilder appendSubtitle(@NonNull String title) {
|
2024-07-02 01:51:13 +01:00
|
|
|
builder.append("**").append(title).append("**").append("\n");
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
2024-07-09 19:46:48 +01:00
|
|
|
public DescriptionBuilder emptyLine() {
|
2024-07-02 01:51:13 +01:00
|
|
|
builder.append("\n");
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
public String build() {
|
|
|
|
return builder.toString();
|
|
|
|
}
|
|
|
|
}
|