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.setStartDate(atp.getStartDate()); |
20 | 0 | term.setEndDate(atp.getEndDate()); |
21 | 0 | term.setTypeKey(atp.getTypeKey()); |
22 | 0 | term.setStateKey(atp.getStateKey()); |
23 | 0 | term.setMeta(atp.getMeta()); |
24 | 0 | term.setAttributes(atp.getAttributes()); |
25 | |
|
26 | 0 | return term; |
27 | |
} |
28 | |
else |
29 | 0 | return null; |
30 | |
} |
31 | |
|
32 | |
@Override |
33 | |
public AtpInfo disassemble(TermInfo term, ContextInfo context) throws AssemblyException{ |
34 | 0 | AtpInfo atp = new AtpInfo(); |
35 | 0 | atp.setId(term.getId()); |
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.setMeta(term.getMeta()); |
43 | 0 | atp.setAttributes(term.getAttributes()); |
44 | |
|
45 | 0 | return atp; |
46 | |
} |
47 | |
|
48 | |
} |