1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.mobility.academics.util;
16
17 import org.apache.commons.collections.Transformer;
18 import org.kuali.mobility.academics.entity.Term;
19 import org.kuali.mobility.academics.entity.TermImpl;
20
21
22
23
24
25 public class TermTransform implements Transformer {
26
27 @Override
28 public TermImpl transform( Object obj ) {
29 TermImpl proxy = null;
30 if( obj instanceof TermImpl ) {
31 proxy = (TermImpl)obj;
32 } else if( obj instanceof Term ) {
33 proxy = new TermImpl();
34 proxy.setId( ((Term)obj).getId() );
35 proxy.setDescription( ((Term)obj).getDescription() );
36 proxy.setShortDescription( ((Term)obj).getShortDescription() );
37 proxy.setActive( ((Term)obj).isActive() );
38 proxy.setCareers( ((Term)obj).getCareers() );
39 }
40
41 return proxy;
42 }
43 }