Package mil.nga.geopackage.db.table
Class Constraint
- java.lang.Object
-
- mil.nga.geopackage.db.table.Constraint
-
- All Implemented Interfaces:
Comparable<Constraint>
- Direct Known Subclasses:
RawConstraint,UniqueConstraint
public abstract class Constraint extends Object implements Comparable<Constraint>
Table or column constraint- Since:
- 3.3.0
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONSTRAINTConstraint keyword
-
Constructor Summary
Constructors Modifier Constructor Description protectedConstraint(ConstraintType type)ConstructorprotectedConstraint(ConstraintType type, Integer order)ConstructorprotectedConstraint(ConstraintType type, String name)ConstructorprotectedConstraint(ConstraintType type, String name, Integer order)Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringbuildNameSql()Build the name SQLabstract StringbuildSql()Build the constraint SQLintcompareTo(Constraint constraint)abstract Constraintcopy()Copy the constraintStringgetName()Get the nameIntegergetOrder()Get the orderConstraintTypegetType()Get the constraint typevoidsetName(String name)Set the namevoidsetOrder(Integer order)Set the order to a number or nullvoidsetType(ConstraintType type)Set the constraint type
-
-
-
Field Detail
-
CONSTRAINT
public static final String CONSTRAINT
Constraint keyword- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Constraint
protected Constraint(ConstraintType type)
Constructor- Parameters:
type- constraint type
-
Constraint
protected Constraint(ConstraintType type, String name)
Constructor- Parameters:
type- constraint typename- constraint name
-
Constraint
protected Constraint(ConstraintType type, Integer order)
Constructor- Parameters:
type- constraint typeorder- constraint order
-
Constraint
protected Constraint(ConstraintType type, String name, Integer order)
Constructor- Parameters:
type- constraint typename- constraint nameorder- constraint order
-
-
Method Detail
-
getName
public String getName()
Get the name- Returns:
- name or null
-
setName
public void setName(String name)
Set the name- Parameters:
name- name
-
getType
public ConstraintType getType()
Get the constraint type- Returns:
- constraint type
-
setType
public void setType(ConstraintType type)
Set the constraint type- Parameters:
type- constraint type
-
getOrder
public Integer getOrder()
Get the order- Returns:
- order number or null
- Since:
- 5.0.0
-
setOrder
public void setOrder(Integer order)
Set the order to a number or null- Parameters:
order- order number- Since:
- 5.0.0
-
buildNameSql
protected String buildNameSql()
Build the name SQL- Returns:
- name SQL
-
compareTo
public int compareTo(Constraint constraint)
- Specified by:
compareToin interfaceComparable<Constraint>
-
buildSql
public abstract String buildSql()
Build the constraint SQL- Returns:
- sql constraint
-
copy
public abstract Constraint copy()
Copy the constraint- Returns:
- copied constraint
-
-