Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AttributeDefinitionMap |
|
| 2.0;2 |
1 | /* | |
2 | * Copyright 2008-2009 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.kim.bo.types.dto; | |
17 | ||
18 | import org.apache.commons.lang.StringUtils; | |
19 | import org.kuali.rice.krad.datadictionary.AttributeDefinition; | |
20 | ||
21 | import java.util.Map; | |
22 | import java.util.TreeMap; | |
23 | ||
24 | /** | |
25 | * Specialization of HashMap to facilitate web services and simplify API definitions. | |
26 | * | |
27 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
28 | * | |
29 | */ | |
30 | public class AttributeDefinitionMap extends TreeMap<String,AttributeDefinition> { | |
31 | ||
32 | public AttributeDefinitionMap() { | |
33 | 0 | super(); |
34 | 0 | } |
35 | ||
36 | public AttributeDefinitionMap( Map<String,AttributeDefinition> map ) { | |
37 | 0 | super( map ); |
38 | 0 | } |
39 | ||
40 | public AttributeDefinition getByAttributeName(String attributeName) { | |
41 | 0 | for (AttributeDefinition definition : values()) { |
42 | 0 | if (StringUtils.equals(attributeName, definition.getName())) |
43 | 0 | return definition; |
44 | } | |
45 | 0 | return null; |
46 | } | |
47 | } |