| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| KeyValue |
|
| 1.8571428571428572;1.857 |
| 1 | /* | |
| 2 | * Copyright 2007-2010 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.core.util; | |
| 17 | ||
| 18 | import java.io.Serializable; | |
| 19 | ||
| 20 | ||
| 21 | /** | |
| 22 | * This is a generic keyValue object. | |
| 23 | * | |
| 24 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 25 | * | |
| 26 | */ | |
| 27 | public class KeyValue implements Serializable { | |
| 28 | ||
| 29 | private String key; | |
| 30 | private String value; | |
| 31 | ||
| 32 | 0 | public KeyValue() { |
| 33 | 0 | } |
| 34 | ||
| 35 | 0 | public KeyValue(String key, String value) { |
| 36 | 0 | this.key = key; |
| 37 | 0 | this.value = value; |
| 38 | 0 | } |
| 39 | ||
| 40 | public String getKey() { | |
| 41 | 0 | return this.key; |
| 42 | } | |
| 43 | ||
| 44 | public void setKey(String key) { | |
| 45 | 0 | this.key = key; |
| 46 | 0 | } |
| 47 | ||
| 48 | public String getValue() { | |
| 49 | 0 | return this.value; |
| 50 | } | |
| 51 | ||
| 52 | public void setValue(String value) { | |
| 53 | 0 | this.value = value; |
| 54 | 0 | } |
| 55 | public boolean equals(Object obj) { | |
| 56 | 0 | if(obj instanceof KeyValue && obj != null){ |
| 57 | 0 | if(((KeyValue)obj).getKey().equals(this.getKey()) && |
| 58 | ((KeyValue)obj).getValue().equals(this.getValue()) ){ | |
| 59 | 0 | return true; |
| 60 | }else{ | |
| 61 | 0 | return false; |
| 62 | } | |
| 63 | }else{ | |
| 64 | 0 | return super.equals(obj); |
| 65 | } | |
| 66 | } | |
| 67 | ||
| 68 | ||
| 69 | ||
| 70 | } |