38679751a4ce5dd020663f51a860c0f5b951912f
[aai/search-data-service.git] / src / main / java / org / openecomp / sa / searchdbabstraction / entity / AggregationResult.java
1 /**
2  * ============LICENSE_START=======================================================
3  * Search Data Service
4  * ================================================================================
5  * Copyright © 2017 AT&T Intellectual Property.
6  * Copyright © 2017 Amdocs
7  * All rights reserved.
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License ati
12  *
13  *    http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  *
22  * ECOMP and OpenECOMP are trademarks
23  * and service marks of AT&T Intellectual Property.
24  */
25 package org.openecomp.sa.searchdbabstraction.entity;
26
27 import com.fasterxml.jackson.annotation.JsonProperty;
28 import edu.emory.mathcs.backport.java.util.Arrays;
29
30 public class AggregationResult {
31   private String name;
32
33   private Number count;
34
35   private AggregationBucket[] buckets;
36
37   @JsonProperty("nested-aggregations")
38   private AggregationResult[] nestedAggregations;
39
40   public String getName() {
41     return name;
42   }
43
44   public void setName(String name) {
45     this.name = name;
46   }
47
48   public AggregationBucket[] getBuckets() {
49     return buckets;
50   }
51
52   public void setBuckets(AggregationBucket[] buckets) {
53     this.buckets = buckets;
54   }
55
56   public AggregationResult[] getNestedAggregations() {
57     return nestedAggregations;
58   }
59
60   public void setNestedAggregations(AggregationResult[] nestedAggregations) {
61     this.nestedAggregations = nestedAggregations;
62   }
63
64   public Number getCount() {
65     return count;
66   }
67
68   public void setCount(Number count) {
69     this.count = count;
70   }
71
72   @Override
73   public String toString() {
74     return "AggregationResult [name=" + name + ", count=" + count + ", buckets="
75         + Arrays.toString(buckets) + ", nestedAggregations=" + Arrays.toString(nestedAggregations)
76         + "]";
77   }
78
79 }