Fix link address of artifact broker package
[multicloud/framework.git] / artifactbroker / main / src / test / java / org / onap / policy / distribution / main / testclasses / DummyArtifactForwarderParameterGroup.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2018 Ericsson. All rights reserved.
4  *  Copyright (C) 2019 Intel. All rights reserved.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.distribution.main.testclasses;
23
24 import org.onap.policy.common.parameters.GroupValidationResult;
25 import org.onap.policy.distribution.main.parameters.ArtifactForwarderConfigurationParameterGroup;
26
27 /**
28  * Dummy policy forwarder parameter group.
29  */
30 public class DummyArtifactForwarderParameterGroup extends ArtifactForwarderConfigurationParameterGroup {
31
32     private boolean useHttps;
33     private String hostname;
34     private int port;
35     private String userName;
36     private String password;
37     private boolean isManaged;
38
39     public boolean isUseHttps() {
40         return useHttps;
41     }
42
43     public String getHostname() {
44         return hostname;
45     }
46
47     public int getPort() {
48         return port;
49     }
50
51     public String getUserName() {
52         return userName;
53     }
54
55     public String getPassword() {
56         return password;
57     }
58
59     public boolean isManaged() {
60         return isManaged;
61     }
62
63     /**
64      * Builder for DummyArtifactForwarderParameterGroup.
65      */
66     public static class DummyArtifactForwarderParameterGroupBuilder {
67         private boolean useHttps;
68         private String hostname;
69         private int port;
70         private String userName;
71         private String password;
72         private boolean isManaged;
73
74         public DummyArtifactForwarderParameterGroupBuilder setUseHttps(final boolean useHttps) {
75             this.useHttps = useHttps;
76             return this;
77         }
78
79         public DummyArtifactForwarderParameterGroupBuilder setHostname(final String hostname) {
80             this.hostname = hostname;
81             return this;
82         }
83
84         public DummyArtifactForwarderParameterGroupBuilder setPort(final int port) {
85             this.port = port;
86             return this;
87         }
88
89         public DummyArtifactForwarderParameterGroupBuilder setUserName(final String userName) {
90             this.userName = userName;
91             return this;
92         }
93
94         public DummyArtifactForwarderParameterGroupBuilder setPassword(final String password) {
95             this.password = password;
96             return this;
97         }
98
99         public DummyArtifactForwarderParameterGroupBuilder setIsManaged(final boolean isManaged) {
100             this.isManaged = isManaged;
101             return this;
102         }
103
104         /**
105          * Creates a new DummyArtifactForwarderParameterGroup instance.
106          */
107         public DummyArtifactForwarderParameterGroup build() {
108             return new DummyArtifactForwarderParameterGroup(this);
109         }
110     }
111
112     /**
113      * Construct an instance.
114      *
115      * @param builder the builder create the instance from
116      */
117     private DummyArtifactForwarderParameterGroup(final DummyArtifactForwarderParameterGroupBuilder builder) {
118         this.useHttps = builder.useHttps;
119         this.hostname = builder.hostname;
120         this.port = builder.port;
121         this.userName = builder.userName;
122         this.password = builder.password;
123         this.isManaged = builder.isManaged;
124     }
125
126     @Override
127     public GroupValidationResult validate() {
128         final GroupValidationResult validationResult = new GroupValidationResult(this);
129         return validationResult;
130     }
131
132 }