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.applicationconstants;
018:
019: import java.io.Serializable;
020:
021: import edu.iu.uis.eden.util.Utilities;
022:
023: /**
024: * Model object for application constants mapped ot ojb.
025: *
026: * @author rkirkend
027: * @author ewestfal
028: *
029: */
030: public class ApplicationConstant implements Serializable {
031:
032: private static final long serialVersionUID = 5561795446088281002L;
033:
034: private String applicationConstantName;
035:
036: private String applicationConstantValue;
037:
038: private Integer lockVerNbr;
039:
040: public ApplicationConstant() {
041: }
042:
043: public ApplicationConstant(String name, String value) {
044: this .applicationConstantName = name;
045: this .applicationConstantValue = value;
046: }
047:
048: /**
049: * @return Returns the applicationConstantName.
050: */
051: public String getApplicationConstantName() {
052: return applicationConstantName;
053: }
054:
055: /**
056: * @param applicationConstantName
057: * The applicationConstantName to set.
058: */
059: public void setApplicationConstantName(
060: String applicationConstantName) {
061: this .applicationConstantName = applicationConstantName;
062: }
063:
064: /**
065: * @return Returns the applicationConstantValue.
066: */
067: public String getApplicationConstantValue() {
068: return applicationConstantValue;
069: }
070:
071: /**
072: * @param applicationConstantValue
073: * The applicationConstantValue to set.
074: */
075: public void setApplicationConstantValue(
076: String applicationConstantValue) {
077: this .applicationConstantValue = applicationConstantValue;
078: }
079:
080: /**
081: * @return Returns the lockVerNbr.
082: */
083: public Integer getLockVerNbr() {
084: return lockVerNbr;
085: }
086:
087: /**
088: * @param lockVerNbr
089: * The lockVerNbr to set.
090: */
091: public void setLockVerNbr(Integer lockVerNbr) {
092: this .lockVerNbr = lockVerNbr;
093: }
094:
095: public int hashCode() {
096: return (applicationConstantName + ":" + applicationConstantValue)
097: .hashCode();
098: }
099:
100: public boolean equals(Object o) {
101: if (!(o instanceof ApplicationConstant))
102: return false;
103: ApplicationConstant ac = (ApplicationConstant) o;
104: return Utilities.equals(applicationConstantName,
105: ac.applicationConstantName)
106: && Utilities.equals(applicationConstantValue,
107: ac.applicationConstantValue);
108: }
109:
110: public String toString() {
111: return "[ApplicationConstant: name=" + applicationConstantName
112: + ", value=" + applicationConstantValue + "]";
113: }
114: }
|