001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package edu.iu.uis.eden.routetemplate;
018:
019: import edu.iu.uis.eden.WorkflowPersistable;
020: import edu.iu.uis.eden.util.Utilities;
021:
022: /**
023: * The value of an extension to a rule. Essentially contains a
024: * key-value pair containing the key of the extension data and
025: * it's value.
026: *
027: * @see RuleBaseValues
028: * @see RuleExtension
029: *
030: * @author rkirkend
031: */
032: public class RuleExtensionValue implements WorkflowPersistable {
033:
034: private static final long serialVersionUID = 8909789087052290261L;
035: private Long ruleExtensionValueId;
036: private Long ruleExtensionId;
037: private String value;
038: private String key;
039: private Integer lockVerNbr;
040:
041: private RuleExtension extension;
042:
043: public RuleExtensionValue() {
044: }
045:
046: public RuleExtensionValue(String key, String value) {
047: this .key = key;
048: this .value = value;
049: }
050:
051: public RuleExtension getExtension() {
052: return extension;
053: }
054:
055: public void setExtension(RuleExtension extension) {
056: this .extension = extension;
057: }
058:
059: public Integer getLockVerNbr() {
060: return lockVerNbr;
061: }
062:
063: public void setLockVerNbr(Integer lockVerNbr) {
064: this .lockVerNbr = lockVerNbr;
065: }
066:
067: public String getKey() {
068: return key;
069: }
070:
071: public void setKey(String key) {
072: this .key = key;
073: }
074:
075: public Long getRuleExtensionId() {
076: return ruleExtensionId;
077: }
078:
079: public void setRuleExtensionId(Long ruleExtensionId) {
080: this .ruleExtensionId = ruleExtensionId;
081: }
082:
083: public Long getRuleExtensionValueId() {
084: return ruleExtensionValueId;
085: }
086:
087: public void setRuleExtensionValueId(Long ruleExtensionValueId) {
088: this .ruleExtensionValueId = ruleExtensionValueId;
089: }
090:
091: public String getValue() {
092: return value;
093: }
094:
095: public void setValue(String value) {
096: this .value = value;
097: }
098:
099: public Object copy(boolean preserveKeys) {
100: RuleExtensionValue ruleExtensionValueClone = new RuleExtensionValue();
101:
102: if (key != null) {
103: ruleExtensionValueClone.setKey(new String(key));
104: }
105: if (preserveKeys && ruleExtensionValueId != null) {
106: ruleExtensionValueClone.setRuleExtensionValueId(new Long(
107: ruleExtensionValueId.longValue()));
108: }
109: if (value != null) {
110: ruleExtensionValueClone.setValue(new String(value));
111: }
112:
113: return ruleExtensionValueClone;
114: }
115:
116: public boolean equals(Object o) {
117: if (o == null)
118: return false;
119: if (!(o instanceof RuleExtensionValue))
120: return false;
121: RuleExtensionValue pred = (RuleExtensionValue) o;
122: return Utilities.equals(key, pred.key)
123: && Utilities.equals(value, pred.value);
124: }
125:
126: public String toString() {
127: return "[RuleExtensionValue:" + " ruleExtensionValueId="
128: + ruleExtensionValueId + ", ruleExtensionId="
129: + ruleExtensionId + ", value=" + value + ", key=" + key
130: + ", lockVerNbr=" + lockVerNbr + "]";
131:
132: }
133: }
|