| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AgendaBo |
|
| 0.0;0 |
| 1 | package org.kuali.rice.krms.impl.repository | |
| 2 | ||
| 3 | import java.util.Set; | |
| 4 | ||
| 5 | import org.kuali.rice.kns.bo.PersistableBusinessObjectBase | |
| 6 | import org.kuali.rice.krms.api.repository.agenda.AgendaDefinition; | |
| 7 | import org.kuali.rice.krms.api.repository.agenda.AgendaDefinitionContract; | |
| 8 | ||
| 9 | ||
| 10 | public class AgendaBo extends PersistableBusinessObjectBase implements AgendaDefinitionContract { | |
| 11 | ||
| 12 | def String id | |
| 13 | def String namespace | |
| 14 | def String name | |
| 15 | def String typeId | |
| 16 | def String contextId | |
| 17 | def Boolean active | |
| 18 | ||
| 19 | def String firstItemId | |
| 20 | def Set<AgendaAttributeBo> attributeBos | |
| 21 | ||
| 22 | def List<AgendaItemBo> items | |
| 23 | ||
| 24 | public String getNamespaceCode(){ | |
| 25 | 8 | return namespace |
| 26 | } | |
| 27 | ||
| 28 | public Map<String, String> getAttributes() { | |
| 29 | 16 | HashMap<String, String> attributes = new HashMap<String, String>(); |
| 30 | 16 | for (attr in attributeBos) { |
| 31 | 32 | attributes.put( attr.attributeDefinition.name, attr.value ) |
| 32 | } | |
| 33 | 16 | return attributes; |
| 34 | } | |
| 35 | ||
| 36 | ||
| 37 | ||
| 38 | // /** | |
| 39 | // * Converts a mutable bo to it's immutable counterpart | |
| 40 | // * @param bo the mutable business object | |
| 41 | // * @return the immutable object | |
| 42 | // */ | |
| 43 | // static AgendaDefinition to(AgendaBo bo) { | |
| 44 | // if (bo == null) { return null } | |
| 45 | // return org.kuali.rice.krms.api.repository.agenda.AgendaDefinition.Builder.create(bo).build() | |
| 46 | // } | |
| 47 | // | |
| 48 | // | |
| 49 | // /** | |
| 50 | // * Converts a immutable object to it's mutable bo counterpart | |
| 51 | // * TODO: move to() and from() to impl service | |
| 52 | // * @param im immutable object | |
| 53 | // * @return the mutable bo | |
| 54 | // */ | |
| 55 | // static public AgendaBo from(AgendaDefinition im) { | |
| 56 | // if (im == null) { return null } | |
| 57 | // | |
| 58 | // AgendaBo bo = new AgendaBo() | |
| 59 | // bo.setId( im.getId() ) | |
| 60 | // bo.setNamespace( im.getNamespaceCode() ) | |
| 61 | // bo.setName( im.getName() ) | |
| 62 | // bo.setTypeId( im.getTypeId() ) | |
| 63 | // bo.setContextId( im.getContextId() ) | |
| 64 | // bo.setFirstItemId( im.getFirstItemId() ) | |
| 65 | // | |
| 66 | // Map<String,String> attrList = convertAttributeKeys | |
| 67 | // Set<AgendaAttributeBo> attrList = new HashSet<AgendaAttributeBo>() | |
| 68 | // for (attr in im.getAttributes()){ | |
| 69 | // | |
| 70 | // attrList.add ( AgendaAttributeBo.from() ) | |
| 71 | // } | |
| 72 | // bo.setAttributes(attrList) | |
| 73 | // return bo | |
| 74 | // } | |
| 75 | ||
| 76 | ||
| 77 | } |