Added the appendDefault method to the StatementBuilder
This commit is contained in:
parent
4a6f0c6901
commit
c6ed5d9b8d
@ -6,6 +6,7 @@ public class StatementBuilder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic constructor of the {@link StatementBuilder} with a prefilled text
|
* Basic constructor of the {@link StatementBuilder} with a prefilled text
|
||||||
|
*
|
||||||
* @param text The text you want to add
|
* @param text The text you want to add
|
||||||
*/
|
*/
|
||||||
public StatementBuilder(String text) {
|
public StatementBuilder(String text) {
|
||||||
@ -21,6 +22,7 @@ public class StatementBuilder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a text to the query with spaces
|
* Adds a text to the query with spaces
|
||||||
|
*
|
||||||
* @param text The text you want to add
|
* @param text The text you want to add
|
||||||
* @return this class
|
* @return this class
|
||||||
*/
|
*/
|
||||||
@ -32,8 +34,23 @@ public class StatementBuilder {
|
|||||||
return this;
|
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
|
* Builds the query string
|
||||||
|
*
|
||||||
* @return the built string
|
* @return the built string
|
||||||
*/
|
*/
|
||||||
public String build() {
|
public String build() {
|
||||||
|
Reference in New Issue
Block a user