1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.impex.model;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import javax.xml.bind.annotation.XmlAccessType;
22 import javax.xml.bind.annotation.XmlAccessorType;
23 import javax.xml.bind.annotation.XmlAttribute;
24 import javax.xml.bind.annotation.XmlElement;
25
26 import org.kuali.common.util.CollectionUtils;
27
28
29
30
31 @XmlAccessorType(XmlAccessType.PROPERTY)
32 public abstract class Constraint implements NamedElement {
33
34 String name;
35 List<String> columnNames = new ArrayList<String>();
36
37
38
39
40 public Constraint(Constraint constraint) {
41 this.name = constraint.getName();
42 this.columnNames = new ArrayList<String>(CollectionUtils.toEmptyList(constraint.getColumnNames()));
43 }
44
45 public Constraint() {
46 super();
47 }
48
49 public Constraint(List<String> columnNames, String name) {
50 this.columnNames = columnNames;
51 this.name = name;
52 }
53
54 @XmlElement(name = "column")
55 public List<String> getColumnNames() {
56 return columnNames;
57 }
58
59 @Override
60 @XmlAttribute
61 public String getName() {
62 return name;
63 }
64
65 public void setName(String name) {
66 this.name = name;
67 }
68
69 public void setColumnNames(List<String> columnNames) {
70 this.columnNames = columnNames;
71 }
72 }