Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TargetBeanOverview |
|
| 2.0;2 |
1 | /* | |
2 | * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch) | |
3 | * All rights reserved. | |
4 | * | |
5 | * Licensed under the Open Permis License which accompanies this distribution, | |
6 | * and is available at http://www.openpermis.org/BSDlicenceKent.txt | |
7 | */ | |
8 | package org.openpermis.editor.policy.adapter.overview; | |
9 | ||
10 | import org.openpermis.policy.bean.TargetBean; | |
11 | ||
12 | ||
13 | /** | |
14 | * Describes a {@link TargetBean} that has been adapted to a short overview string. | |
15 | * @since 0.3.0 | |
16 | */ | |
17 | 1 | public class TargetBeanOverview implements Overview { |
18 | ||
19 | ||
20 | //---- Static | |
21 | ||
22 | //---- State | |
23 | ||
24 | private TargetBean target; | |
25 | ||
26 | //---- Constructors | |
27 | ||
28 | /** | |
29 | * Creates a target bean overview adaptee. | |
30 | * @param target the {@link TargetBean}. | |
31 | * @since 0.3.0 | |
32 | */ | |
33 | 2 | public TargetBeanOverview (TargetBean target) { |
34 | 2 | if (target == null) { |
35 | 1 | throw new IllegalArgumentException("Target is null."); |
36 | } | |
37 | 1 | this.target = target; |
38 | 1 | } |
39 | ||
40 | //---- Methods | |
41 | ||
42 | //---- Overview | |
43 | ||
44 | /** | |
45 | * @since 0.3.0 | |
46 | */ | |
47 | public String get () { | |
48 | 1 | return "Target " + this.target.getSerialNumber().toString(); |
49 | } | |
50 | ||
51 | } |