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 String
CONSTRAINT
Constraint keyword
-
Constructor Summary
Constructors Modifier Constructor Description protected
Constraint(ConstraintType type)
Constructorprotected
Constraint(ConstraintType type, Integer order)
Constructorprotected
Constraint(ConstraintType type, String name)
Constructorprotected
Constraint(ConstraintType type, String name, Integer order)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
buildNameSql()
Build the name SQLabstract String
buildSql()
Build the constraint SQLint
compareTo(Constraint constraint)
abstract Constraint
copy()
Copy the constraintString
getName()
Get the nameInteger
getOrder()
Get the orderConstraintType
getType()
Get the constraint typevoid
setName(String name)
Set the namevoid
setOrder(Integer order)
Set the order to a number or nullvoid
setType(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:
compareTo
in 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
-
-