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