Coverage Report - org.kuali.rice.kim.bo.types.dto.KimTypeInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
KimTypeInfo
0%
0/37
0%
0/16
1.8
 
 1  
 /*
 2  
  * Copyright 2007-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 java.io.Serializable;
 19  
 import java.util.ArrayList;
 20  
 import java.util.LinkedHashMap;
 21  
 import java.util.List;
 22  
 
 23  
 import org.apache.commons.lang.StringUtils;
 24  
 import org.kuali.rice.kim.bo.KimType;
 25  
 import org.kuali.rice.kns.bo.TransientBusinessObjectBase;
 26  
 
 27  
 /**
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 29  
  */
 30  
 public class KimTypeInfo extends TransientBusinessObjectBase implements KimType, Serializable {
 31  
 
 32  
         private static final long serialVersionUID = 4229466320569714756L;
 33  
         
 34  
         protected String kimTypeId;
 35  
         protected String name;
 36  
         protected String namespaceCode;
 37  
         protected String kimTypeServiceName;
 38  
 
 39  
         protected List<KimTypeAttributeInfo> attributeDefinitions;
 40  
 
 41  0
         public KimTypeInfo() {
 42  0
                 attributeDefinitions = new ArrayList<KimTypeAttributeInfo> ();
 43  0
         }
 44  
 
 45  
         public List<KimTypeAttributeInfo> getAttributeDefinitions() {
 46  0
                 return attributeDefinitions;
 47  
         }
 48  
 
 49  
         public String getKimTypeId() {
 50  0
                 return kimTypeId;
 51  
         }
 52  
 
 53  
         public String getKimTypeServiceName() {
 54  0
                 return kimTypeServiceName;
 55  
         }
 56  
 
 57  
         public String getName() {
 58  0
                 return name;
 59  
         }
 60  
 
 61  
         public void setAttributeDefinitions(List<KimTypeAttributeInfo> attributeDefinitions) {
 62  0
                 this.attributeDefinitions = attributeDefinitions;
 63  0
         }
 64  
         
 65  
         public KimTypeAttributeInfo getAttributeDefinition( String kimAttributeId ) {
 66  0
                 if ( kimAttributeId == null || attributeDefinitions == null ) {
 67  0
                         return null;
 68  
                 }
 69  0
                 for ( KimTypeAttributeInfo def : attributeDefinitions ) {
 70  0
                         if ( def.kimAttributeId.equals( kimAttributeId ) ) {
 71  0
                                 return def;
 72  
                         }
 73  
                 }
 74  0
                 return null;
 75  
         }
 76  
 
 77  
         public KimTypeAttributeInfo getAttributeDefinitionByName( String attributeName ) {
 78  0
                 if ( attributeName == null || attributeDefinitions == null ) {
 79  0
                         return null;
 80  
                 }
 81  0
                 for ( KimTypeAttributeInfo def : attributeDefinitions ) {
 82  0
                         if ( StringUtils.equals(def.attributeName, attributeName) ) {
 83  0
                                 return def;
 84  
                         }
 85  
                 }
 86  0
                 return null;
 87  
         }
 88  
         
 89  
         public void setKimTypeServiceName(String kimTypeServiceName) {
 90  0
                 this.kimTypeServiceName = kimTypeServiceName;
 91  0
         }
 92  
 
 93  
         public void setName(String name) {
 94  0
                 this.name = name;
 95  0
         }
 96  
 
 97  
         @Override
 98  
         public String toString() {
 99  0
                 LinkedHashMap<String,Object> m = new LinkedHashMap<String,Object>();
 100  0
                 m.put( "kimTypeId", kimTypeId );
 101  0
                 m.put( "name", name );
 102  0
                 m.put( "kimTypeServiceName", kimTypeServiceName );
 103  0
                 m.put( "attributeDefinitions",  attributeDefinitions );
 104  0
                 return m.toString();
 105  
         }
 106  
 
 107  
         public String getNamespaceCode() {
 108  0
                 return this.namespaceCode;
 109  
         }
 110  
 
 111  
         public void setNamespaceCode(String namespaceCode) {
 112  0
                 this.namespaceCode = namespaceCode;
 113  0
         }
 114  
 
 115  
         public void setKimTypeId(String kimTypeId) {
 116  0
                 this.kimTypeId = kimTypeId;
 117  0
         }
 118  
 
 119  
         /**
 120  
          * This overridden method ...
 121  
          * 
 122  
          * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
 123  
          */
 124  
         @SuppressWarnings("unchecked")
 125  
         @Override
 126  
         protected LinkedHashMap toStringMapper() {
 127  0
                 return null;
 128  
         }
 129  
 
 130  
 }