1 | |
package liquibase.statement; |
2 | |
|
3 | |
import java.util.ArrayList; |
4 | |
import java.util.Arrays; |
5 | |
import java.util.List; |
6 | |
|
7 | |
public class UniqueConstraint implements ColumnConstraint { |
8 | |
private String constraintName; |
9 | 1 | private List<String> columns = new ArrayList<String>(); |
10 | |
|
11 | 0 | public UniqueConstraint() { |
12 | |
|
13 | 0 | } |
14 | |
|
15 | 1 | public UniqueConstraint(String constraintName) { |
16 | 1 | this.constraintName = constraintName; |
17 | 1 | } |
18 | |
|
19 | |
public UniqueConstraint addColumns(String... columns) { |
20 | 1 | this.columns.addAll(Arrays.asList(columns)); |
21 | |
|
22 | 1 | return this; |
23 | |
} |
24 | |
|
25 | |
public String getConstraintName() { |
26 | 0 | return constraintName; |
27 | |
} |
28 | |
|
29 | |
public void setConstraintName(String constraintName) { |
30 | 0 | this.constraintName = constraintName; |
31 | 0 | } |
32 | |
|
33 | |
public List<String> getColumns() { |
34 | 2 | return columns; |
35 | |
} |
36 | |
} |