public class StatementBuilder
extends java.lang.Object
Constructor and Description |
---|
StatementBuilder(int maxBodySize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
append(java.lang.String head,
java.lang.String item,
java.lang.String separator,
java.lang.String terminator)
Appends an item.
|
java.lang.String |
build()
Builds the SQL-statement and resets the builder.
|
java.util.List<java.lang.String> |
getItems()
Returns the items of the current statement.
|
int |
getMaxBodySize()
Gets the maximal size of a body-list.
|
boolean |
isAppendable(java.lang.String head)
Checks whether an item is appendable to previously appended items.
|
boolean |
isEmpty()
Checks if builder is empty.
|
int |
size()
Returns the size of the current statement.
|
public StatementBuilder(int maxBodySize)
maxBodySize
- the maximal size of a body-listpublic boolean isAppendable(java.lang.String head)
head
- the statements headtrue
iff item is appendablepublic java.lang.String build()
public void append(java.lang.String head, java.lang.String item, java.lang.String separator, java.lang.String terminator)
head
- same head as previously appended, if anyitem
- the itemseparator
- separates the itemsterminator
- terminates the statementpublic boolean isEmpty()
true
if builder is emptypublic int size()
public java.util.List<java.lang.String> getItems()
public int getMaxBodySize()