Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CaseConstraint |
|
| 1.0;1 |
1 | /** | |
2 | * Copyright 2005-2011 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.krad.datadictionary.validation.constraint; | |
17 | ||
18 | import javax.xml.bind.annotation.XmlAccessType; | |
19 | import javax.xml.bind.annotation.XmlAccessorType; | |
20 | import javax.xml.bind.annotation.XmlElement; | |
21 | import java.util.List; | |
22 | ||
23 | /** | |
24 | * A case constraint is a constraint that is imposed only when a certain condition is met, for example, if the country attribute value is "USA", | |
25 | * then a prerequisite constraint may be imposed that the 'State' attribute is non-null. | |
26 | * | |
27 | * This class is a direct copy of one that was in Kuali Student. | |
28 | * | |
29 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
30 | * @since 1.1 | |
31 | */ | |
32 | @XmlAccessorType(XmlAccessType.FIELD) | |
33 | 5 | public class CaseConstraint extends BaseConstraint { |
34 | @XmlElement | |
35 | protected List<WhenConstraint> whenConstraint; | |
36 | @XmlElement | |
37 | protected String propertyName; | |
38 | @XmlElement | |
39 | protected String operator; | |
40 | @XmlElement | |
41 | protected boolean caseSensitive; | |
42 | ||
43 | public List<WhenConstraint> getWhenConstraint() { | |
44 | 2 | return whenConstraint; |
45 | } | |
46 | ||
47 | public void setWhenConstraint(List<WhenConstraint> whenConstraint) { | |
48 | 5 | this.whenConstraint = whenConstraint; |
49 | 5 | } |
50 | ||
51 | public String getPropertyName() { | |
52 | 2 | return propertyName; |
53 | } | |
54 | ||
55 | public void setPropertyName(String propertyName) { | |
56 | 0 | this.propertyName = propertyName; |
57 | 0 | } |
58 | ||
59 | public String getOperator() { | |
60 | 2 | return operator; |
61 | } | |
62 | ||
63 | public void setOperator(String operator) { | |
64 | 0 | this.operator = operator; |
65 | 0 | } |
66 | ||
67 | public boolean isCaseSensitive() { | |
68 | 2 | return caseSensitive; |
69 | } | |
70 | ||
71 | public void setCaseSensitive(boolean caseSensitive) { | |
72 | 5 | this.caseSensitive = caseSensitive; |
73 | 5 | } |
74 | } |