2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2018 Ericsson. All rights reserved.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.distribution.main.rest;
24 * Class to represent statistics report of distribution service.
26 * @author Ram Krishna Verma (ram.krishna.verma@ericsson.com)
28 public class StatisticsReport {
31 private long totalDistributionCount;
32 private long distributionSuccessCount;
33 private long distributionFailureCount;
34 private long totalDownloadCount;
35 private long downloadSuccessCount;
36 private long downloadFailureCount;
39 * Returns the code of this {@link StatisticsReport} instance.
43 public int getCode() {
48 * Set code in this {@link StatisticsReport} instance.
50 * @param code the code to set
52 public void setCode(final int code) {
57 * Returns the totalDistributionCount of this {@link StatisticsReport} instance.
59 * @return the totalDistributionCount
61 public long getTotalDistributionCount() {
62 return totalDistributionCount;
66 * Set totalDistributionCount in this {@link StatisticsReport} instance.
68 * @param totalDistributionCount the totalDistributionCount to set
70 public void setTotalDistributionCount(final long totalDistributionCount) {
71 this.totalDistributionCount = totalDistributionCount;
75 * Returns the distributionSuccessCount of this {@link StatisticsReport} instance.
77 * @return the distributionSuccessCount
79 public long getDistributionSuccessCount() {
80 return distributionSuccessCount;
84 * Set distributionSuccessCount in this {@link StatisticsReport} instance.
86 * @param distributionSuccessCount the distributionSuccessCount to set
88 public void setDistributionSuccessCount(final long distributionSuccessCount) {
89 this.distributionSuccessCount = distributionSuccessCount;
93 * Returns the distributionFailureCount of this {@link StatisticsReport} instance.
95 * @return the distributionFailureCount
97 public long getDistributionFailureCount() {
98 return distributionFailureCount;
102 * Set distributionFailureCount in this {@link StatisticsReport} instance.
104 * @param distributionFailureCount the distributionFailureCount to set
106 public void setDistributionFailureCount(final long distributionFailureCount) {
107 this.distributionFailureCount = distributionFailureCount;
111 * Returns the totalDownloadCount of this {@link StatisticsReport} instance.
113 * @return the totalDownloadCount
115 public long getTotalDownloadCount() {
116 return totalDownloadCount;
120 * Set totalDownloadCount in this {@link StatisticsReport} instance.
122 * @param totalDownloadCount the totalDownloadCount to set
124 public void setTotalDownloadCount(final long totalDownloadCount) {
125 this.totalDownloadCount = totalDownloadCount;
129 * Returns the downloadSuccessCount of this {@link StatisticsReport} instance.
131 * @return the downloadSuccessCount
133 public long getDownloadSuccessCount() {
134 return downloadSuccessCount;
138 * Set downloadSuccessCount in this {@link StatisticsReport} instance.
140 * @param downloadSuccessCount the downloadSuccessCount to set
142 public void setDownloadSuccessCount(final long downloadSuccessCount) {
143 this.downloadSuccessCount = downloadSuccessCount;
147 * Returns the downloadFailureCount of this {@link StatisticsReport} instance.
149 * @return the downloadFailureCount
151 public long getDownloadFailureCount() {
152 return downloadFailureCount;
156 * Set downloadFailureCount in this {@link StatisticsReport} instance.
158 * @param downloadFailureCount the downloadFailureCount to set
160 public void setDownloadFailureCount(final long downloadFailureCount) {
161 this.downloadFailureCount = downloadFailureCount;
169 public String toString() {
170 final StringBuilder builder = new StringBuilder();
171 builder.append("StatisticsReport [code=");
172 builder.append(getCode());
173 builder.append(", totalDistributionCount=");
174 builder.append(getTotalDistributionCount());
175 builder.append(", distributionSuccessCount=");
176 builder.append(getDistributionSuccessCount());
177 builder.append(", distributionFailureCount=");
178 builder.append(getDistributionFailureCount());
179 builder.append(", totalDownloadCount=");
180 builder.append(getTotalDownloadCount());
181 builder.append(", downloadSuccessCount=");
182 builder.append(getDownloadSuccessCount());
183 builder.append(", downloadFailureCount=");
184 builder.append(getDownloadFailureCount());
186 return builder.toString();