| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 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 | |
|
| 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 | |
|
| 121 | |
|
| 122 | |
|
| 123 | |
|
| 124 | |
@SuppressWarnings("unchecked") |
| 125 | |
@Override |
| 126 | |
protected LinkedHashMap toStringMapper() { |
| 127 | 0 | return null; |
| 128 | |
} |
| 129 | |
|
| 130 | |
} |