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.Subject;
19 import org.kuali.mobility.academics.entity.SubjectImpl;
20
21
22
23
24
25 public class SubjectTransform implements Transformer {
26
27 @Override
28 public SubjectImpl transform( Object obj ) {
29 SubjectImpl proxy = null;
30
31 if( obj instanceof SubjectImpl ) {
32 proxy = (SubjectImpl)obj;
33 } else if( obj instanceof Subject ) {
34 proxy = new SubjectImpl();
35 proxy.setId( ((Subject)obj).getId() );
36 proxy.setDescription( ((Subject)obj).getDescription() );
37 proxy.setShortDescription( ((Subject)obj).getShortDescription() );
38 }
39 return proxy;
40 }
41
42 }