Class ColumnDefBuilder
- java.lang.Object
-
- com.ibm.fhir.database.utils.model.ColumnDefBuilder
-
- Direct Known Subclasses:
RowType.Builder
,RowTypeBuilder
public class ColumnDefBuilder extends Object
Builder pattern to make it easy to add column definitions to an object (e.g. table, type etc)
-
-
Field Summary
Fields Modifier and Type Field Description protected LinkedHashSet<ColumnDef>
columns
-
Constructor Summary
Constructors Constructor Description ColumnDefBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnDefBuilder
addBigIntColumn(String columnName, boolean nullable)
ColumnDefBuilder
addBlobColumn(String columnName, long size, int inlineSize, boolean nullable)
ColumnDefBuilder
addCharColumn(String columnName, int size, boolean nullable)
Add char (fixed-width) columnColumnDefBuilder
addDoubleColumn(String columnName, boolean nullable)
ColumnDefBuilder
addIntColumn(String columnName, boolean nullable)
ColumnDefBuilder
addSmallIntColumn(String columnName, Integer defaultValue, boolean nullable)
ColumnDefBuilder
addTimestampColumn(String columnName, boolean nullable)
ColumnDefBuilder
addVarcharColumn(String columnName, int size, boolean nullable)
List<ColumnBase>
buildColumns()
Create the columns for the table based on the definitions that have been addedvoid
checkColumnAlreadyExists(ColumnDef cd, String columnName)
protected void
checkColumns(String[] columns)
Check each of the columns in the given array are valid column namesprotected void
checkColumns(Collection<String> columns)
Check each of the columns in the given array are valid column names
-
-
-
Field Detail
-
columns
protected LinkedHashSet<ColumnDef> columns
-
-
Method Detail
-
addIntColumn
public ColumnDefBuilder addIntColumn(String columnName, boolean nullable)
-
addSmallIntColumn
public ColumnDefBuilder addSmallIntColumn(String columnName, Integer defaultValue, boolean nullable)
-
addBigIntColumn
public ColumnDefBuilder addBigIntColumn(String columnName, boolean nullable)
-
addDoubleColumn
public ColumnDefBuilder addDoubleColumn(String columnName, boolean nullable)
-
addTimestampColumn
public ColumnDefBuilder addTimestampColumn(String columnName, boolean nullable)
-
addVarcharColumn
public ColumnDefBuilder addVarcharColumn(String columnName, int size, boolean nullable)
-
addCharColumn
public ColumnDefBuilder addCharColumn(String columnName, int size, boolean nullable)
Add char (fixed-width) column- Parameters:
columnName
-size
-nullable
-- Returns:
-
addBlobColumn
public ColumnDefBuilder addBlobColumn(String columnName, long size, int inlineSize, boolean nullable)
-
checkColumns
protected void checkColumns(String[] columns)
Check each of the columns in the given array are valid column names- Parameters:
columns
-
-
checkColumns
protected void checkColumns(Collection<String> columns)
Check each of the columns in the given array are valid column names- Parameters:
columns
-
-
buildColumns
public List<ColumnBase> buildColumns()
Create the columns for the table based on the definitions that have been added- Returns:
-
-