1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.mobility.computerlabs.util;
16
17 import org.apache.commons.collections.Transformer;
18 import org.kuali.mobility.computerlabs.entity.LabGroup;
19 import org.kuali.mobility.computerlabs.entity.LabGroupImpl;
20 import org.kuali.mobility.computerlabs.entity.Location;
21
22
23
24
25
26 public class LabGroupTransform implements Transformer {
27
28 @Override
29 public LabGroupImpl transform( Object obj ) {
30 LabGroupImpl proxy = null;
31 if( obj instanceof LabGroupImpl ) {
32 proxy = (LabGroupImpl)obj;
33 } else if( obj instanceof LabGroup ) {
34 proxy = new LabGroupImpl();
35 proxy.setName( ((LabGroup)obj).getName() );
36 proxy.setLocations( ((LabGroup)obj).getLocations() );
37 }
38 return proxy;
39 }
40 }