1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package de.smartics.properties.tutorial.property.constraints;
17
18 import java.net.URL;
19
20 import javax.validation.constraints.Min;
21 import javax.validation.constraints.NotNull;
22
23 import org.hibernate.validator.constraints.NotBlank;
24
25 import de.smartics.properties.api.core.annotations.AccessType;
26 import de.smartics.properties.api.core.annotations.PropertyExpression;
27 import de.smartics.properties.api.core.annotations.PropertyIntValueRange;
28 import de.smartics.properties.api.core.annotations.PropertyLifecycle;
29 import de.smartics.properties.api.core.annotations.PropertySet;
30 import de.smartics.properties.api.core.domain.PropertyKey;
31
32
33
34
35 @PropertySet(value = "tutorial.property.constraints")
36 public interface ConstraintsProperties
37 {
38
39
40
41 @NotBlank
42 @PropertyLifecycle(access = AccessType.READ_WRITE)
43 String host();
44
45 PropertyKey hostPropertyKey();
46
47
48
49
50 @NotNull
51 @PropertyLifecycle(access = AccessType.READ_WRITE)
52 URL server();
53
54 PropertyKey serverPropertyKey();
55
56
57
58
59
60 @PropertyIntValueRange(value = { 0, 1, 2, 3, 5, 8, 13, 21, 50, 100 },
61 defaultValue = 8)
62 @NotNull
63 @PropertyLifecycle(access = AccessType.READ_WRITE)
64 Integer storyPoint();
65
66
67
68 PropertyKey storyPointPropertyKey();
69
70
71
72
73 @PropertyExpression("required")
74 @PropertyLifecycle(access = AccessType.READ_WRITE)
75 Priority priority();
76
77 PropertyKey priorityPropertyKey();
78
79
80
81
82 @PropertyExpression("0")
83 @Min(0)
84 @PropertyLifecycle(access = AccessType.READ_WRITE)
85 int happiness();
86
87 PropertyKey happinessPropertyKey();
88
89
90
91
92 @PropertyExpression("0")
93 @RealHappiness
94 @PropertyLifecycle(access = AccessType.READ_WRITE)
95 int realHappiness();
96
97 PropertyKey realHappinessPropertyKey();
98 }