View Javadoc
1   /*
2    * Copyright 2012-2017 CodeLibs Project and the Others.
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,
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.codelibs.fess.es.config.cbean.ca.bs;
17  
18  import org.codelibs.fess.es.config.allcommon.EsAbstractConditionAggregation;
19  import org.codelibs.fess.es.config.allcommon.EsAbstractConditionQuery;
20  import org.codelibs.fess.es.config.cbean.ca.WebConfigToLabelCA;
21  import org.codelibs.fess.es.config.cbean.cq.WebConfigToLabelCQ;
22  import org.codelibs.fess.es.config.cbean.cq.bs.BsWebConfigToLabelCQ;
23  import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
24  import org.elasticsearch.search.aggregations.bucket.global.GlobalAggregationBuilder;
25  import org.elasticsearch.search.aggregations.bucket.missing.MissingAggregationBuilder;
26  import org.elasticsearch.search.aggregations.bucket.range.ip.IpRangeAggregationBuilder;
27  import org.elasticsearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder;
28  import org.elasticsearch.search.aggregations.bucket.significant.SignificantTermsAggregationBuilder;
29  import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
30  import org.elasticsearch.search.aggregations.metrics.cardinality.CardinalityAggregationBuilder;
31  import org.elasticsearch.search.aggregations.metrics.scripted.ScriptedMetricAggregationBuilder;
32  import org.elasticsearch.search.aggregations.metrics.tophits.TopHitsAggregationBuilder;
33  import org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountAggregationBuilder;
34  
35  /**
36   * @author ESFlute (using FreeGen)
37   */
38  public abstract class BsWebConfigToLabelCA extends EsAbstractConditionAggregation {
39  
40      // ===================================================================================
41      //                                                                     Aggregation Set
42      //                                                                           =========
43  
44      public void filter(String name, EsAbstractConditionQuery.OperatorCall<BsWebConfigToLabelCQ> queryLambda,
45              ConditionOptionCall<FilterAggregationBuilder> opLambda, OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
46          WebConfigToLabelCQ cq = new WebConfigToLabelCQ();
47          if (queryLambda != null) {
48              queryLambda.callback(cq);
49          }
50          FilterAggregationBuilder builder = regFilterA(name, cq.getQuery());
51          if (opLambda != null) {
52              opLambda.callback(builder);
53          }
54          if (aggsLambda != null) {
55              WebConfigToLabelCA ca = new WebConfigToLabelCA();
56              aggsLambda.callback(ca);
57              ca.getAggregationBuilderList().forEach(builder::subAggregation);
58          }
59      }
60  
61      public void global(String name, ConditionOptionCall<GlobalAggregationBuilder> opLambda, OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
62          GlobalAggregationBuilder builder = regGlobalA(name);
63          if (opLambda != null) {
64              opLambda.callback(builder);
65          }
66          if (aggsLambda != null) {
67              WebConfigToLabelCA ca = new WebConfigToLabelCA();
68              aggsLambda.callback(ca);
69              ca.getAggregationBuilderList().forEach(builder::subAggregation);
70          }
71      }
72  
73      public void sampler(String name, ConditionOptionCall<SamplerAggregationBuilder> opLambda, OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
74          SamplerAggregationBuilder builder = regSamplerA(name);
75          if (opLambda != null) {
76              opLambda.callback(builder);
77          }
78          if (aggsLambda != null) {
79              WebConfigToLabelCA ca = new WebConfigToLabelCA();
80              aggsLambda.callback(ca);
81              ca.getAggregationBuilderList().forEach(builder::subAggregation);
82          }
83      }
84  
85      public void scriptedMetric(String name, ConditionOptionCall<ScriptedMetricAggregationBuilder> opLambda) {
86          ScriptedMetricAggregationBuilder builder = regScriptedMetricA(name);
87          if (opLambda != null) {
88              opLambda.callback(builder);
89          }
90      }
91  
92      public void topHits(String name, ConditionOptionCall<TopHitsAggregationBuilder> opLambda) {
93          TopHitsAggregationBuilder builder = regTopHitsA(name);
94          if (opLambda != null) {
95              opLambda.callback(builder);
96          }
97      }
98  
99      public void setLabelTypeId_Terms() {
100         setLabelTypeId_Terms(null);
101     }
102 
103     public void setLabelTypeId_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda) {
104         setLabelTypeId_Terms("labelTypeId", opLambda, null);
105     }
106 
107     public void setLabelTypeId_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda, OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
108         setLabelTypeId_Terms("labelTypeId", opLambda, aggsLambda);
109     }
110 
111     public void setLabelTypeId_Terms(String name, ConditionOptionCall<TermsAggregationBuilder> opLambda,
112             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
113         TermsAggregationBuilder builder = regTermsA(name, "labelTypeId");
114         if (opLambda != null) {
115             opLambda.callback(builder);
116         }
117         if (aggsLambda != null) {
118             WebConfigToLabelCA ca = new WebConfigToLabelCA();
119             aggsLambda.callback(ca);
120             ca.getAggregationBuilderList().forEach(builder::subAggregation);
121         }
122     }
123 
124     public void setLabelTypeId_SignificantTerms() {
125         setLabelTypeId_SignificantTerms(null);
126     }
127 
128     public void setLabelTypeId_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda) {
129         setLabelTypeId_SignificantTerms("labelTypeId", opLambda, null);
130     }
131 
132     public void setLabelTypeId_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
133             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
134         setLabelTypeId_SignificantTerms("labelTypeId", opLambda, aggsLambda);
135     }
136 
137     public void setLabelTypeId_SignificantTerms(String name, ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
138             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
139         SignificantTermsAggregationBuilder builder = regSignificantTermsA(name, "labelTypeId");
140         if (opLambda != null) {
141             opLambda.callback(builder);
142         }
143         if (aggsLambda != null) {
144             WebConfigToLabelCA ca = new WebConfigToLabelCA();
145             aggsLambda.callback(ca);
146             ca.getAggregationBuilderList().forEach(builder::subAggregation);
147         }
148     }
149 
150     public void setLabelTypeId_IpRange() {
151         setLabelTypeId_IpRange(null);
152     }
153 
154     public void setLabelTypeId_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda) {
155         setLabelTypeId_IpRange("labelTypeId", opLambda, null);
156     }
157 
158     public void setLabelTypeId_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda,
159             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
160         setLabelTypeId_IpRange("labelTypeId", opLambda, aggsLambda);
161     }
162 
163     public void setLabelTypeId_IpRange(String name, ConditionOptionCall<IpRangeAggregationBuilder> opLambda,
164             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
165         IpRangeAggregationBuilder builder = regIpRangeA(name, "labelTypeId");
166         if (opLambda != null) {
167             opLambda.callback(builder);
168         }
169         if (aggsLambda != null) {
170             WebConfigToLabelCA ca = new WebConfigToLabelCA();
171             aggsLambda.callback(ca);
172             ca.getAggregationBuilderList().forEach(builder::subAggregation);
173         }
174     }
175 
176     public void setLabelTypeId_Count() {
177         setLabelTypeId_Count(null);
178     }
179 
180     public void setLabelTypeId_Count(ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
181         setLabelTypeId_Count("labelTypeId", opLambda);
182     }
183 
184     public void setLabelTypeId_Count(String name, ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
185         ValueCountAggregationBuilder builder = regCountA(name, "labelTypeId");
186         if (opLambda != null) {
187             opLambda.callback(builder);
188         }
189     }
190 
191     public void setLabelTypeId_Cardinality() {
192         setLabelTypeId_Cardinality(null);
193     }
194 
195     public void setLabelTypeId_Cardinality(ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
196         setLabelTypeId_Cardinality("labelTypeId", opLambda);
197     }
198 
199     public void setLabelTypeId_Cardinality(String name, ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
200         CardinalityAggregationBuilder builder = regCardinalityA(name, "labelTypeId");
201         if (opLambda != null) {
202             opLambda.callback(builder);
203         }
204     }
205 
206     public void setLabelTypeId_Missing() {
207         setLabelTypeId_Missing(null);
208     }
209 
210     public void setLabelTypeId_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda) {
211         setLabelTypeId_Missing("labelTypeId", opLambda, null);
212     }
213 
214     public void setLabelTypeId_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda,
215             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
216         setLabelTypeId_Missing("labelTypeId", opLambda, aggsLambda);
217     }
218 
219     public void setLabelTypeId_Missing(String name, ConditionOptionCall<MissingAggregationBuilder> opLambda,
220             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
221         MissingAggregationBuilder builder = regMissingA(name, "labelTypeId");
222         if (opLambda != null) {
223             opLambda.callback(builder);
224         }
225         if (aggsLambda != null) {
226             WebConfigToLabelCA ca = new WebConfigToLabelCA();
227             aggsLambda.callback(ca);
228             ca.getAggregationBuilderList().forEach(builder::subAggregation);
229         }
230     }
231 
232     public void setWebConfigId_Terms() {
233         setWebConfigId_Terms(null);
234     }
235 
236     public void setWebConfigId_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda) {
237         setWebConfigId_Terms("webConfigId", opLambda, null);
238     }
239 
240     public void setWebConfigId_Terms(ConditionOptionCall<TermsAggregationBuilder> opLambda, OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
241         setWebConfigId_Terms("webConfigId", opLambda, aggsLambda);
242     }
243 
244     public void setWebConfigId_Terms(String name, ConditionOptionCall<TermsAggregationBuilder> opLambda,
245             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
246         TermsAggregationBuilder builder = regTermsA(name, "webConfigId");
247         if (opLambda != null) {
248             opLambda.callback(builder);
249         }
250         if (aggsLambda != null) {
251             WebConfigToLabelCA ca = new WebConfigToLabelCA();
252             aggsLambda.callback(ca);
253             ca.getAggregationBuilderList().forEach(builder::subAggregation);
254         }
255     }
256 
257     public void setWebConfigId_SignificantTerms() {
258         setWebConfigId_SignificantTerms(null);
259     }
260 
261     public void setWebConfigId_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda) {
262         setWebConfigId_SignificantTerms("webConfigId", opLambda, null);
263     }
264 
265     public void setWebConfigId_SignificantTerms(ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
266             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
267         setWebConfigId_SignificantTerms("webConfigId", opLambda, aggsLambda);
268     }
269 
270     public void setWebConfigId_SignificantTerms(String name, ConditionOptionCall<SignificantTermsAggregationBuilder> opLambda,
271             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
272         SignificantTermsAggregationBuilder builder = regSignificantTermsA(name, "webConfigId");
273         if (opLambda != null) {
274             opLambda.callback(builder);
275         }
276         if (aggsLambda != null) {
277             WebConfigToLabelCA ca = new WebConfigToLabelCA();
278             aggsLambda.callback(ca);
279             ca.getAggregationBuilderList().forEach(builder::subAggregation);
280         }
281     }
282 
283     public void setWebConfigId_IpRange() {
284         setWebConfigId_IpRange(null);
285     }
286 
287     public void setWebConfigId_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda) {
288         setWebConfigId_IpRange("webConfigId", opLambda, null);
289     }
290 
291     public void setWebConfigId_IpRange(ConditionOptionCall<IpRangeAggregationBuilder> opLambda,
292             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
293         setWebConfigId_IpRange("webConfigId", opLambda, aggsLambda);
294     }
295 
296     public void setWebConfigId_IpRange(String name, ConditionOptionCall<IpRangeAggregationBuilder> opLambda,
297             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
298         IpRangeAggregationBuilder builder = regIpRangeA(name, "webConfigId");
299         if (opLambda != null) {
300             opLambda.callback(builder);
301         }
302         if (aggsLambda != null) {
303             WebConfigToLabelCA ca = new WebConfigToLabelCA();
304             aggsLambda.callback(ca);
305             ca.getAggregationBuilderList().forEach(builder::subAggregation);
306         }
307     }
308 
309     public void setWebConfigId_Count() {
310         setWebConfigId_Count(null);
311     }
312 
313     public void setWebConfigId_Count(ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
314         setWebConfigId_Count("webConfigId", opLambda);
315     }
316 
317     public void setWebConfigId_Count(String name, ConditionOptionCall<ValueCountAggregationBuilder> opLambda) {
318         ValueCountAggregationBuilder builder = regCountA(name, "webConfigId");
319         if (opLambda != null) {
320             opLambda.callback(builder);
321         }
322     }
323 
324     public void setWebConfigId_Cardinality() {
325         setWebConfigId_Cardinality(null);
326     }
327 
328     public void setWebConfigId_Cardinality(ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
329         setWebConfigId_Cardinality("webConfigId", opLambda);
330     }
331 
332     public void setWebConfigId_Cardinality(String name, ConditionOptionCall<CardinalityAggregationBuilder> opLambda) {
333         CardinalityAggregationBuilder builder = regCardinalityA(name, "webConfigId");
334         if (opLambda != null) {
335             opLambda.callback(builder);
336         }
337     }
338 
339     public void setWebConfigId_Missing() {
340         setWebConfigId_Missing(null);
341     }
342 
343     public void setWebConfigId_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda) {
344         setWebConfigId_Missing("webConfigId", opLambda, null);
345     }
346 
347     public void setWebConfigId_Missing(ConditionOptionCall<MissingAggregationBuilder> opLambda,
348             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
349         setWebConfigId_Missing("webConfigId", opLambda, aggsLambda);
350     }
351 
352     public void setWebConfigId_Missing(String name, ConditionOptionCall<MissingAggregationBuilder> opLambda,
353             OperatorCall<BsWebConfigToLabelCA> aggsLambda) {
354         MissingAggregationBuilder builder = regMissingA(name, "webConfigId");
355         if (opLambda != null) {
356             opLambda.callback(builder);
357         }
358         if (aggsLambda != null) {
359             WebConfigToLabelCA ca = new WebConfigToLabelCA();
360             aggsLambda.callback(ca);
361             ca.getAggregationBuilderList().forEach(builder::subAggregation);
362         }
363     }
364 
365 }