View Javadoc
1   /*
2    * Copyright (c) 2016 ingenieux Labs
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  // CHECKSTYLE:OFF
18  /**
19   * Source code generated by Fluent Builders Generator Do not modify this file See generator home
20   * page at: http://code.google.com/p/fluent-builders-generator-eclipse-plugin/
21   */
22  package br.com.ingenieux.mojo.beanstalk.cmd.env.create;
23  
24  import com.amazonaws.services.elasticbeanstalk.model.ConfigurationOptionSetting;
25  import com.amazonaws.services.elasticbeanstalk.model.OptionSpecification;
26  import com.amazonaws.services.elasticbeanstalk.model.Tag;
27  
28  import java.util.ArrayList;
29  import java.util.List;
30  import java.util.Map;
31  
32  public class CreateEnvironmentContextBuilder extends CreateEnvironmentContextBuilderBase<CreateEnvironmentContextBuilder> {
33  
34    public CreateEnvironmentContextBuilder() {
35      super(new CreateEnvironmentContext());
36    }
37  
38    public static CreateEnvironmentContextBuilder createEnvironmentContext() {
39      return new CreateEnvironmentContextBuilder();
40    }
41  
42    public CreateEnvironmentContext build() {
43      return getInstance();
44    }
45  }
46  
47  class CreateEnvironmentContextBuilderBase<GeneratorT extends CreateEnvironmentContextBuilderBase<GeneratorT>> {
48  
49    private CreateEnvironmentContext instance;
50  
51    protected CreateEnvironmentContextBuilderBase(CreateEnvironmentContext aInstance) {
52      instance = aInstance;
53    }
54  
55    protected CreateEnvironmentContext getInstance() {
56      return instance;
57    }
58  
59    @SuppressWarnings("unchecked")
60    public GeneratorT withApplicationName(String aValue) {
61      instance.setApplicationName(aValue);
62  
63      return (GeneratorT) this;
64    }
65  
66    @SuppressWarnings("unchecked")
67    public GeneratorT withCnamePrefix(String aValue) {
68      instance.setCnamePrefix(aValue);
69  
70      return (GeneratorT) this;
71    }
72  
73    @SuppressWarnings("unchecked")
74    public GeneratorT withApplicationDescription(String aValue) {
75      instance.setApplicationDescription(aValue);
76  
77      return (GeneratorT) this;
78    }
79  
80    @SuppressWarnings("unchecked")
81    public GeneratorT withOptionSettings(ConfigurationOptionSetting[] aValue) {
82      instance.setOptionSettings(aValue);
83  
84      return (GeneratorT) this;
85    }
86  
87    @SuppressWarnings("unchecked")
88    public GeneratorT withOptionsToRemove(OptionSpecification[] aValue) {
89      instance.setOptionsToRemove(aValue);
90  
91      return (GeneratorT) this;
92    }
93  
94    @SuppressWarnings("unchecked")
95    public GeneratorT withEnvironmentName(String aValue) {
96      instance.setEnvironmentName(aValue);
97  
98      return (GeneratorT) this;
99    }
100 
101   @SuppressWarnings("unchecked")
102   public GeneratorT withVersionLabel(String aValue) {
103     instance.setVersionLabel(aValue);
104 
105     return (GeneratorT) this;
106   }
107 
108   @SuppressWarnings("unchecked")
109   public GeneratorT withSolutionStack(String aValue) {
110     instance.setSolutionStack(aValue);
111 
112     return (GeneratorT) this;
113   }
114 
115   @SuppressWarnings("unchecked")
116   public GeneratorT withTemplateName(String aValue) {
117     instance.setTemplateName(aValue);
118 
119     return (GeneratorT) this;
120   }
121 
122   @SuppressWarnings("unchecked")
123   public GeneratorT withEnvironmentTierName(String aValue) {
124     instance.setEnvironmentTierName(aValue);
125 
126     return (GeneratorT) this;
127   }
128 
129   @SuppressWarnings("unchecked")
130   public GeneratorT withEnvironmentTierType(String aValue) {
131     instance.setEnvironmentTierType(aValue);
132 
133     return (GeneratorT) this;
134   }
135 
136   @SuppressWarnings("unchecked")
137   public GeneratorT withEnvironmentTierVersion(String aValue) {
138     instance.setEnvironmentTierVersion(aValue);
139 
140     return (GeneratorT) this;
141   }
142 
143   @SuppressWarnings("unchecked")
144   public GeneratorT withTags(Map<String, String> tags) {
145     if (tags != null) {
146       List<Tag> tagList = new ArrayList<Tag>(tags.size());
147       for (String key : tags.keySet()) {
148         tagList.add(new Tag().withKey(key).withValue(tags.get(key)));
149       }
150       instance.setTags(tagList);
151     }
152     return (GeneratorT) this;
153   }
154 }