812326139d5086a9a69ecadf80435b4577e98b2e
[appc.git] / appc-metric / appc-metric-bundle / src / main / java / org / openecomp / appc / metricservice / metric / impl / DispatchingFunctionCounterBuilderImpl.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
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 at
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  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.openecomp.appc.metricservice.metric.impl;
26
27 import org.openecomp.appc.metricservice.metric.DispatchingFunctionCounterBuilder;
28 import org.openecomp.appc.metricservice.metric.DispatchingFuntionMetric;
29 import org.openecomp.appc.metricservice.metric.MetricType;
30
31
32 public class DispatchingFunctionCounterBuilderImpl implements DispatchingFunctionCounterBuilder {
33     private  String name;
34     private  MetricType metricType;
35     private long acceptedRequested;
36     private long rejectedRequest;
37
38     @Override
39     public DispatchingFunctionCounterBuilder withName(String name) {
40         this.name=name;
41         return this;
42     }
43
44     @Override
45     public DispatchingFunctionCounterBuilder withAcceptRequestValue(long value) {
46         this.acceptedRequested=value;
47         return this;
48     }
49     @Override
50     public DispatchingFunctionCounterBuilder withRejectRequestValue(long value) {
51         this.rejectedRequest=value;
52         return this;
53     }
54     @Override
55     public DispatchingFunctionCounterBuilder withType(MetricType type) {
56         this.metricType=type;
57         return this;
58     }
59
60     @Override
61     public DispatchingFuntionMetric build() {
62         return new DispatchingFuntionMetricImpl(this.name,this.metricType,this.acceptedRequested,this.rejectedRequest);
63     }
64 }