diff --git a/src/main/java/de/gnmyt/sqltoolkit/querybuilder/StatementBuilder.java b/src/main/java/de/gnmyt/sqltoolkit/querybuilder/StatementBuilder.java index 43d0c8a..ad33830 100644 --- a/src/main/java/de/gnmyt/sqltoolkit/querybuilder/StatementBuilder.java +++ b/src/main/java/de/gnmyt/sqltoolkit/querybuilder/StatementBuilder.java @@ -6,6 +6,7 @@ public class StatementBuilder { /** * Basic constructor of the {@link StatementBuilder} with a prefilled text + * * @param text The text you want to add */ public StatementBuilder(String text) { @@ -21,6 +22,7 @@ public class StatementBuilder { /** * Adds a text to the query with spaces + * * @param text The text you want to add * @return this class */ @@ -32,8 +34,23 @@ public class StatementBuilder { return this; } + /** + * Adds a text to the query without spaces + * + * @param text The text you want to add + * @return this class + */ + public StatementBuilder appendDefault(String text) { + if (text.isEmpty()) return this; + + query.append(text); + + return this; + } + /** * Builds the query string + * * @return the built string */ public String build() {