1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package br.com.ingenieux.mojo.beanstalk.cmd.env.waitfor;
22
23 public class WaitForEnvironmentContextBuilder extends WaitForEnvironmentContextBuilderBase<WaitForEnvironmentContextBuilder> {
24
25 public WaitForEnvironmentContextBuilder() {
26 super(new WaitForEnvironmentContext());
27 }
28
29 public static WaitForEnvironmentContextBuilder waitForEnvironmentContext() {
30 return new WaitForEnvironmentContextBuilder();
31 }
32
33 public WaitForEnvironmentContext build() {
34 return getInstance();
35 }
36 }
37
38 class WaitForEnvironmentContextBuilderBase<GeneratorT extends WaitForEnvironmentContextBuilderBase<GeneratorT>> {
39
40 private WaitForEnvironmentContext instance;
41
42 protected WaitForEnvironmentContextBuilderBase(WaitForEnvironmentContext aInstance) {
43 instance = aInstance;
44 }
45
46 protected WaitForEnvironmentContext getInstance() {
47 return instance;
48 }
49
50 @SuppressWarnings("unchecked")
51 public GeneratorT withApplicationName(String aValue) {
52 instance.setApplicationName(aValue);
53
54 return (GeneratorT) this;
55 }
56
57 @SuppressWarnings("unchecked")
58 public GeneratorT withTimeoutMins(Integer aValue) {
59 instance.setTimeoutMins(aValue);
60
61 return (GeneratorT) this;
62 }
63
64 @SuppressWarnings("unchecked")
65 public GeneratorT withHealth(String health) {
66 instance.setHealth(health);
67
68 return (GeneratorT) this;
69 }
70
71 @SuppressWarnings("unchecked")
72 public GeneratorT withStatusToWaitFor(String aValue) {
73 instance.setStatusToWaitFor(aValue);
74
75 return (GeneratorT) this;
76 }
77
78 @SuppressWarnings("unchecked")
79 public GeneratorT withEnvironmentRef(String aValue) {
80 instance.setEnvironmentRef(aValue);
81
82 return (GeneratorT) this;
83 }
84 }