1 package fr.ifremer.quadrige3.synchro.service.client;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 import fr.ifremer.quadrige3.core.dao.technical.decorator.Decorator;
27 import fr.ifremer.quadrige3.core.service.decorator.DecoratorService;
28 import fr.ifremer.quadrige3.core.service.decorator.DecoratorServiceImpl;
29 import org.springframework.context.annotation.Lazy;
30 import org.springframework.stereotype.Service;
31
32
33
34
35 @Service("decoratorService")
36 @Lazy
37 public class MockDecoratorService extends DecoratorServiceImpl implements DecoratorService {
38
39
40 @Override
41 @SuppressWarnings("unchecked")
42 public <O> Decorator<O> getDecorator(O object) {
43 return new Decorator<O>((object == null) ? (Class<O>) Object.class : (Class<O>) object.getClass(), "", "", "", false) {
44 @Override
45 public String toString(Object o) {
46 return (o == null) ? "null" : o.toString();
47 }
48 };
49 }
50
51
52 @Override
53 public <O> Decorator<O> getDecorator(O object, String name) {
54 return getDecorator(object);
55 }
56
57 }