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 voidaddColumnConstraint(String columnName, Constraint constraint)Add a column constraintvoidaddColumnConstraints(String columnName, Collection<Constraint> constraints)Add column constraintsvoidaddColumnConstraints(Collection<ColumnConstraints> constraints)Add column constraintsvoidaddColumnConstraints(Map<String,ColumnConstraints> constraints)Add column constraintsvoidaddColumnConstraints(ColumnConstraints constraints)Add column constraintsvoidaddConstraints(TableConstraints constraints)Add table constraintsvoidaddTableConstraint(Constraint constraint)Add a table constraintvoidaddTableConstraints(Constraints constraints)Add table constraintsConstraintgetColumnConstraint(String columnName, int index)Get the column constraint at the indexMap<String,ColumnConstraints>getColumnConstraints()Get the column constraintsColumnConstraintsgetColumnConstraints(String columnName)Get the column constraintsSet<String>getColumnsWithConstraints()Get the column names with constraintsConstraintgetTableConstraint(int index)Get the table constraint at the indexConstraintsgetTableConstraints()Get the table constraintsbooleanhasColumnConstraints()Check if there are column constraintsbooleanhasColumnConstraints(String columnName)Check if there are column constraints for the column namebooleanhasConstraints()Check if there are constraintsbooleanhasTableConstraints()Check if there are table constraintsintnumColumnConstraints(String columnName)Get the number of column constraints for the column nameintnumTableConstraints()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
-
-