20f433d06edc09d65cc5717624de11979af79272
[policy/distribution.git] /
1 /*-
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
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.distribution.main.testclasses;
22
23 import org.onap.policy.common.parameters.GroupValidationResult;
24 import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
25
26 public class DummyReceptionHandlerParameterGroup extends ReceptionHandlerConfigurationParameterGroup {
27
28     private String myStringParameter;
29     private int myIntegerParameter;
30     private boolean myBooleanParameter;
31
32     /**
33      * Inner static class is to used as a Builder.
34      *
35      */
36     public static class DummyReceptionHandlerParameterGroupBuilder {
37         private String myStringParameter;
38         private int myIntegerParameter;
39         private boolean myBooleanParameter;
40
41         public DummyReceptionHandlerParameterGroupBuilder setMyStringParameter(final String val) {
42             myStringParameter = val;
43             return this;
44         }
45
46         public DummyReceptionHandlerParameterGroupBuilder setMyIntegerParameter(final int val) {
47             myIntegerParameter = val;
48             return this;
49         }
50
51         public DummyReceptionHandlerParameterGroupBuilder setMyBooleanParameter(final boolean val) {
52             myBooleanParameter = val;
53             return this;
54         }
55
56         /**
57          * Creates a new DummyReceptionHandlerConfigurationParameterGroup instance.
58          */
59         public DummyReceptionHandlerParameterGroup build() {
60             return new DummyReceptionHandlerParameterGroup(this);
61         }
62     }
63
64     /**
65      * The constructor for instantiating PssdConfigurationParameterGroup. It is kept private so that
66      * it could only be called by PssdConfigurationBuilder.
67      *
68      * @param builder stores all the values used by PssdConfigurationParametersGroup
69      */
70     private DummyReceptionHandlerParameterGroup(final DummyReceptionHandlerParameterGroupBuilder builder) {
71         myStringParameter = builder.myStringParameter;
72         myIntegerParameter = builder.myIntegerParameter;
73         myBooleanParameter = builder.myBooleanParameter;
74     }
75
76     public String getMyStringParameter() {
77         return myStringParameter;
78     }
79
80     public int getMyIntegerParameter() {
81         return myIntegerParameter;
82     }
83
84     public boolean isMyBooleanParameter() {
85         return myBooleanParameter;
86     }
87
88
89     /**
90      * {@inheritDoc}.
91      */
92     @Override
93     public GroupValidationResult validate() {
94         return new GroupValidationResult(this);
95     }
96
97 }
98