Package mil.nga.geopackage.db.table
Class TableConstraints
- java.lang.Object
-
- mil.nga.geopackage.db.table.TableConstraints
-
public class TableConstraints extends Object
Table Constraints including column constraint- Since:
- 3.3.0
- Author:
- osbornb
-
-
Constructor Summary
Constructors Constructor Description TableConstraints()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColumnConstraint(String columnName, Constraint constraint)
Add a column constraintvoid
addColumnConstraints(String columnName, Collection<Constraint> constraints)
Add column constraintsvoid
addColumnConstraints(Collection<ColumnConstraints> constraints)
Add column constraintsvoid
addColumnConstraints(Map<String,ColumnConstraints> constraints)
Add column constraintsvoid
addColumnConstraints(ColumnConstraints constraints)
Add column constraintsvoid
addConstraints(TableConstraints constraints)
Add table constraintsvoid
addTableConstraint(Constraint constraint)
Add a table constraintvoid
addTableConstraints(Constraints constraints)
Add table constraintsConstraint
getColumnConstraint(String columnName, int index)
Get the column constraint at the indexMap<String,ColumnConstraints>
getColumnConstraints()
Get the column constraintsColumnConstraints
getColumnConstraints(String columnName)
Get the column constraintsSet<String>
getColumnsWithConstraints()
Get the column names with constraintsConstraint
getTableConstraint(int index)
Get the table constraint at the indexConstraints
getTableConstraints()
Get the table constraintsboolean
hasColumnConstraints()
Check if there are column constraintsboolean
hasColumnConstraints(String columnName)
Check if there are column constraints for the column nameboolean
hasConstraints()
Check if there are constraintsboolean
hasTableConstraints()
Check if there are table constraintsint
numColumnConstraints(String columnName)
Get the number of column constraints for the column nameint
numTableConstraints()
Get the number of table constraints
-
-
-
Method Detail
-
addTableConstraint
public void addTableConstraint(Constraint constraint)
Add a table constraint- Parameters:
constraint
- constraint
-
addTableConstraints
public void addTableConstraints(Constraints constraints)
Add table constraints- Parameters:
constraints
- constraints- Since:
- 5.0.0
-
getTableConstraints
public Constraints getTableConstraints()
Get the table constraints- Returns:
- table constraints
- Since:
- 5.0.0
-
getTableConstraint
public Constraint getTableConstraint(int index)
Get the table constraint at the index- Parameters:
index
- constraint index- Returns:
- table constraint
-
numTableConstraints
public int numTableConstraints()
Get the number of table constraints- Returns:
- table constraints count
-
addColumnConstraint
public void addColumnConstraint(String columnName, Constraint constraint)
Add a column constraint- Parameters:
columnName
- column nameconstraint
- constraint
-
addColumnConstraints
public void addColumnConstraints(String columnName, Collection<Constraint> constraints)
Add column constraints- Parameters:
columnName
- column nameconstraints
- constraints
-
addColumnConstraints
public void addColumnConstraints(ColumnConstraints constraints)
Add column constraints- Parameters:
constraints
- constraints
-
addColumnConstraints
public void addColumnConstraints(Map<String,ColumnConstraints> constraints)
Add column constraints- Parameters:
constraints
- column constraints
-
addColumnConstraints
public void addColumnConstraints(Collection<ColumnConstraints> constraints)
Add column constraints- Parameters:
constraints
- column constraints
-
getColumnConstraints
public Map<String,ColumnConstraints> getColumnConstraints()
Get the column constraints- Returns:
- column constraints
-
getColumnsWithConstraints
public Set<String> getColumnsWithConstraints()
Get the column names with constraints- Returns:
- column names
-
getColumnConstraints
public ColumnConstraints getColumnConstraints(String columnName)
Get the column constraints- Parameters:
columnName
- column name- Returns:
- constraints
-
getColumnConstraint
public Constraint getColumnConstraint(String columnName, int index)
Get the column constraint at the index- Parameters:
columnName
- column nameindex
- constraint index- Returns:
- column constraint
-
numColumnConstraints
public int numColumnConstraints(String columnName)
Get the number of column constraints for the column name- Parameters:
columnName
- column name- Returns:
- column constraints count
-
addConstraints
public void addConstraints(TableConstraints constraints)
Add table constraints- Parameters:
constraints
- table constraints
-
hasConstraints
public boolean hasConstraints()
Check if there are constraints- Returns:
- true if has constraints
-
hasTableConstraints
public boolean hasTableConstraints()
Check if there are table constraints- Returns:
- true if has table constraints
-
hasColumnConstraints
public boolean hasColumnConstraints()
Check if there are column constraints- Returns:
- true if has column constraints
-
hasColumnConstraints
public boolean hasColumnConstraints(String columnName)
Check if there are column constraints for the column name- Parameters:
columnName
- column name- Returns:
- true if has column constraints
-
-