| 1 | |
package org.kuali.student.enrollment.classII.acal.service.assembler; |
| 2 | |
|
| 3 | |
|
| 4 | |
import org.kuali.student.enrollment.acal.dto.TermInfo; |
| 5 | |
import org.kuali.student.r2.common.dto.ContextInfo; |
| 6 | |
import org.kuali.student.r2.common.infc.AtpAssembler; |
| 7 | |
import org.kuali.student.r2.core.atp.dto.AtpInfo; |
| 8 | |
|
| 9 | 0 | public class TermAssembler implements AtpAssembler<TermInfo, AtpInfo>{ |
| 10 | |
|
| 11 | |
@Override |
| 12 | |
public TermInfo assemble(AtpInfo atp, ContextInfo context) { |
| 13 | 0 | if(atp != null){ |
| 14 | 0 | TermInfo term = TermInfo.newInstance(); |
| 15 | 0 | term.setKey(atp.getKey()); |
| 16 | 0 | term.setName(atp.getName()); |
| 17 | 0 | term.setDescr(atp.getDescr()); |
| 18 | 0 | term.setStartDate(atp.getStartDate()); |
| 19 | 0 | term.setEndDate(atp.getEndDate()); |
| 20 | 0 | term.setTypeKey(atp.getTypeKey()); |
| 21 | 0 | term.setStateKey(atp.getStateKey()); |
| 22 | 0 | term.setMetaInfo(atp.getMetaInfo()); |
| 23 | 0 | term.setAttributes(atp.getAttributes()); |
| 24 | |
|
| 25 | 0 | return term; |
| 26 | |
} |
| 27 | |
else |
| 28 | 0 | return null; |
| 29 | |
} |
| 30 | |
|
| 31 | |
@Override |
| 32 | |
public AtpInfo disassemble(TermInfo term, ContextInfo context) { |
| 33 | 0 | AtpInfo atp = AtpInfo.newInstance(); |
| 34 | 0 | atp.setKey(term.getKey()); |
| 35 | 0 | atp.setKey(term.getKey()); |
| 36 | 0 | atp.setName(term.getName()); |
| 37 | 0 | atp.setDescr(term.getDescr()); |
| 38 | 0 | atp.setStartDate(term.getStartDate()); |
| 39 | 0 | atp.setEndDate(term.getEndDate()); |
| 40 | 0 | atp.setTypeKey(term.getTypeKey()); |
| 41 | 0 | atp.setStateKey(term.getStateKey()); |
| 42 | 0 | atp.setMetaInfo(term.getMetaInfo()); |
| 43 | 0 | atp.setAttributes(term.getAttributes()); |
| 44 | |
|
| 45 | |
|
| 46 | 0 | return atp; |
| 47 | |
} |
| 48 | |
|
| 49 | |
} |