public abstract class UserColumn extends Object implements Comparable<UserColumn>
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_INDEX
User Column index value
|
| Modifier | Constructor and Description |
|---|---|
protected |
UserColumn(int index,
String name,
GeoPackageDataType dataType,
Long max,
boolean notNull,
Object defaultValue,
boolean primaryKey)
Constructor
|
protected |
UserColumn(int index,
String name,
String type,
GeoPackageDataType dataType,
Long max,
boolean notNull,
Object defaultValue,
boolean primaryKey)
Constructor
|
protected |
UserColumn(TableColumn tableColumn)
Constructor
|
protected |
UserColumn(UserColumn userColumn)
Copy Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConstraint(Constraint constraint)
Add a constraint
|
void |
addConstraint(String constraint)
Add a constraint
|
void |
addConstraints(Collection<Constraint> constraints)
Add constraints
|
void |
addConstraints(ColumnConstraints constraints)
Add constraints
|
void |
addDefaultConstraints()
Add the default constraints that are enabled (not null, default value,
primary key) from the column properties
|
void |
addDefaultValueConstraint(Object defaultValue)
Add a default value constraint
|
void |
addNotNullConstraint()
Add a not null constraint
|
void |
addPrimaryKeyConstraint()
Add a primary key constraint
|
void |
addUniqueConstraint()
Add a unique constraint
|
List<Constraint> |
clearConstraints()
Clear the constraints
|
int |
compareTo(UserColumn another)
Sort by index
|
abstract UserColumn |
copy()
Copy the column
|
List<Constraint> |
getConstraints()
Get the constraints
|
GeoPackageDataType |
getDataType()
Get the data type
|
Object |
getDefaultValue()
Get the default value
|
int |
getIndex()
Get the index
|
Long |
getMax()
Get the max
|
String |
getName()
Get the name
|
String |
getType()
Get the database type
|
protected static String |
getTypeName(String name,
GeoPackageDataType dataType)
Get the type name from the data type
|
boolean |
hasConstraints()
Check if has constraints
|
boolean |
hasDefaultValue()
Determine if the column has a default value
|
boolean |
hasIndex()
Check if the column has a valid index
|
boolean |
hasMax()
Determine if the column has a max value
|
boolean |
isNamed(String name)
Determine if this column is named the provided name
|
boolean |
isNotNull()
Get the is not null flag
|
boolean |
isPrimaryKey()
Get the primary key flag
|
void |
resetIndex()
Reset the column index
|
void |
setDataType(GeoPackageDataType dataType)
Set the data type
|
void |
setDefaultValue(Object defaultValue)
Set the default value
|
void |
setIndex(int index)
Set the column index.
|
void |
setMax(Long max)
Set the max
|
void |
setName(String name)
Set the name
|
void |
setNotNull(boolean notNull)
Set the not null flag
|
void |
setPrimaryKey(boolean primaryKey)
Set the primary key flag
|
void |
setType(String type)
Set the database type
|
protected static void |
validateDataType(String name,
GeoPackageDataType dataType)
Validate the data type
|
public static final int NO_INDEX
protected UserColumn(int index,
String name,
GeoPackageDataType dataType,
Long max,
boolean notNull,
Object defaultValue,
boolean primaryKey)
index - column indexname - column namedataType - data typemax - max valuenotNull - not null flagdefaultValue - default valueprimaryKey - primary key flagprotected UserColumn(int index,
String name,
String type,
GeoPackageDataType dataType,
Long max,
boolean notNull,
Object defaultValue,
boolean primaryKey)
index - column indexname - column nametype - string typedataType - data typemax - max valuenotNull - not null flagdefaultValue - default valueprimaryKey - primary key flagprotected UserColumn(TableColumn tableColumn)
tableColumn - table columnprotected UserColumn(UserColumn userColumn)
userColumn - user columnprotected static String getTypeName(String name, GeoPackageDataType dataType)
name - column namedataType - data typeprotected static void validateDataType(String name, GeoPackageDataType dataType)
name - column namedataType - data typepublic abstract UserColumn copy()
public boolean hasIndex()
public void setIndex(int index)
hasIndex() is false (
getIndex() is NO_INDEX). Setting a valid index to an
existing valid index does nothing.index - column indexpublic void resetIndex()
public int getIndex()
public void setName(String name)
name - column namepublic String getName()
public boolean isNamed(String name)
name - column namepublic boolean hasMax()
public void setMax(Long max)
max - maxpublic Long getMax()
public void setNotNull(boolean notNull)
notNull - not null flagpublic boolean isNotNull()
public boolean hasDefaultValue()
public void setDefaultValue(Object defaultValue)
defaultValue - default valuepublic Object getDefaultValue()
public void setPrimaryKey(boolean primaryKey)
primaryKey - primary key flagpublic boolean isPrimaryKey()
public void setDataType(GeoPackageDataType dataType)
dataType - data typepublic GeoPackageDataType getDataType()
public void setType(String type)
type - database typepublic String getType()
public boolean hasConstraints()
public List<Constraint> getConstraints()
public List<Constraint> clearConstraints()
public void addDefaultConstraints()
public void addConstraint(Constraint constraint)
constraint - constraintpublic void addConstraint(String constraint)
constraint - constraintpublic void addConstraints(Collection<Constraint> constraints)
constraints - constraintspublic void addConstraints(ColumnConstraints constraints)
constraints - constraintspublic void addNotNullConstraint()
public void addDefaultValueConstraint(Object defaultValue)
defaultValue - default valuepublic void addPrimaryKeyConstraint()
public void addUniqueConstraint()
public int compareTo(UserColumn another)
compareTo in interface Comparable<UserColumn>Copyright © 2019 National Geospatial-Intelligence Agency. All rights reserved.