View Javadoc

1   /**
2    * Copyright 2011 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.common.impex.model;
17  
18  import java.util.List;
19  
20  import javax.xml.bind.annotation.XmlAccessType;
21  import javax.xml.bind.annotation.XmlAccessorType;
22  import javax.xml.bind.annotation.XmlAttribute;
23  
24  @XmlAccessorType(XmlAccessType.PROPERTY)
25  public class Index extends Constraint {
26  
27  	public static final Boolean DEFAULT_UNIQUE_VALUE = false;
28  
29  	Boolean unique = DEFAULT_UNIQUE_VALUE;
30  
31  	/**
32  	 * This is a copy constructor. It must create a perfect, deep, copy of this object
33  	 */
34  	public Index(Index index) {
35  		super(index);
36  		this.unique = index.isUnique();
37  	}
38  
39  	public Index() {
40  		super();
41  	}
42  
43  	public Index(List<String> colNames, String name) {
44  		super(colNames, name);
45  	}
46  
47  	public Index(List<String> colNames, String name, Boolean unique) {
48  		this(colNames, name);
49  		this.unique = unique;
50  	}
51  
52  	@XmlAttribute
53  	public Boolean isUnique() {
54  		return unique;
55  	}
56  
57  	public void setUnique(Boolean unique) {
58  		this.unique = unique;
59  	}
60  
61  }