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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.distribution.main.testclasses;
24 import org.onap.policy.common.parameters.GroupValidationResult;
25 import org.onap.policy.distribution.main.parameters.ArtifactForwarderConfigurationParameterGroup;
28 * Dummy policy forwarder parameter group.
30 public class DummyArtifactForwarderParameterGroup extends ArtifactForwarderConfigurationParameterGroup {
32 private boolean useHttps;
33 private String hostname;
35 private String userName;
36 private String password;
37 private boolean isManaged;
39 public boolean isUseHttps() {
43 public String getHostname() {
47 public int getPort() {
51 public String getUserName() {
55 public String getPassword() {
59 public boolean isManaged() {
64 * Builder for DummyArtifactForwarderParameterGroup.
66 public static class DummyArtifactForwarderParameterGroupBuilder {
67 private boolean useHttps;
68 private String hostname;
70 private String userName;
71 private String password;
72 private boolean isManaged;
74 public DummyArtifactForwarderParameterGroupBuilder setUseHttps(final boolean useHttps) {
75 this.useHttps = useHttps;
79 public DummyArtifactForwarderParameterGroupBuilder setHostname(final String hostname) {
80 this.hostname = hostname;
84 public DummyArtifactForwarderParameterGroupBuilder setPort(final int port) {
89 public DummyArtifactForwarderParameterGroupBuilder setUserName(final String userName) {
90 this.userName = userName;
94 public DummyArtifactForwarderParameterGroupBuilder setPassword(final String password) {
95 this.password = password;
99 public DummyArtifactForwarderParameterGroupBuilder setIsManaged(final boolean isManaged) {
100 this.isManaged = isManaged;
105 * Creates a new DummyArtifactForwarderParameterGroup instance.
107 public DummyArtifactForwarderParameterGroup build() {
108 return new DummyArtifactForwarderParameterGroup(this);
113 * Construct an instance.
115 * @param builder the builder create the instance from
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;
127 public GroupValidationResult validate() {
128 final GroupValidationResult validationResult = new GroupValidationResult(this);
129 return validationResult;