001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.datadictionary.validation.constraint;
017
018import javax.xml.bind.annotation.XmlAccessType;
019import javax.xml.bind.annotation.XmlAccessorType;
020import javax.xml.bind.annotation.XmlElement;
021import java.util.List;
022
023/**
024 * 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",
025 * then a prerequisite constraint may be imposed that the 'State' attribute is non-null. 
026 * 
027 * This class is a direct copy of one that was in Kuali Student. 
028 * 
029 * @author Kuali Rice Team (rice.collab@kuali.org)
030 * @since 1.1
031 */
032@XmlAccessorType(XmlAccessType.FIELD)
033public class CaseConstraint extends BaseConstraint {
034        @XmlElement
035    protected List<WhenConstraint> whenConstraint;
036        @XmlElement
037        protected String propertyName;
038        @XmlElement
039        protected String operator;
040        @XmlElement
041        protected boolean caseSensitive;
042
043        public List<WhenConstraint> getWhenConstraint() {
044                return whenConstraint;
045        }
046
047        public void setWhenConstraint(List<WhenConstraint> whenConstraint) {
048                this.whenConstraint = whenConstraint;
049        }
050
051        public String getPropertyName() {
052                return propertyName;
053        }
054
055        public void setPropertyName(String propertyName) {
056                this.propertyName = propertyName;
057        }
058
059        public String getOperator() {
060                return operator;
061        }
062
063        public void setOperator(String operator) {
064                this.operator = operator;
065        }
066
067    public boolean isCaseSensitive() {
068        return caseSensitive;
069    }
070
071    public void setCaseSensitive(boolean caseSensitive) {
072        this.caseSensitive = caseSensitive;
073    }
074}