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.testclasses;
 
  23 import org.onap.policy.common.parameters.GroupValidationResult;
 
  24 import org.onap.policy.distribution.main.parameters.PolicyForwarderConfigurationParameterGroup;
 
  27  * Dummy policy forwarder parameter group.
 
  29 public class DummyPolicyForwarderParameterGroup extends PolicyForwarderConfigurationParameterGroup {
 
  31     private boolean useHttps;
 
  32     private String hostname;
 
  34     private String userName;
 
  35     private String password;
 
  36     private boolean isManaged;
 
  38     public boolean isUseHttps() {
 
  42     public String getHostname() {
 
  46     public int getPort() {
 
  50     public String getUserName() {
 
  54     public String getPassword() {
 
  58     public boolean isManaged() {
 
  63      * Builder for DummyPolicyForwarderParameterGroup.
 
  65     public static class DummyPolicyForwarderParameterGroupBuilder {
 
  66         private boolean useHttps;
 
  67         private String hostname;
 
  69         private String userName;
 
  70         private String password;
 
  71         private boolean isManaged;
 
  73         public DummyPolicyForwarderParameterGroupBuilder setUseHttps(final boolean useHttps) {
 
  74             this.useHttps = useHttps;
 
  78         public DummyPolicyForwarderParameterGroupBuilder setHostname(final String hostname) {
 
  79             this.hostname = hostname;
 
  83         public DummyPolicyForwarderParameterGroupBuilder setPort(final int port) {
 
  88         public DummyPolicyForwarderParameterGroupBuilder setUserName(final String userName) {
 
  89             this.userName = userName;
 
  93         public DummyPolicyForwarderParameterGroupBuilder setPassword(final String password) {
 
  94             this.password = password;
 
  98         public DummyPolicyForwarderParameterGroupBuilder setIsManaged(final boolean isManaged) {
 
  99             this.isManaged = isManaged;
 
 104          * Creates a new DummyPolicyForwarderParameterGroup instance.
 
 106         public DummyPolicyForwarderParameterGroup build() {
 
 107             return new DummyPolicyForwarderParameterGroup(this);
 
 112      * Construct an instance.
 
 114      * @param builder the builder create the instance from
 
 116     private DummyPolicyForwarderParameterGroup(final DummyPolicyForwarderParameterGroupBuilder builder) {
 
 117         this.useHttps = builder.useHttps;
 
 118         this.hostname = builder.hostname;
 
 119         this.port = builder.port;
 
 120         this.userName = builder.userName;
 
 121         this.password = builder.password;
 
 122         this.isManaged = builder.isManaged;
 
 126     public GroupValidationResult validate() {
 
 127         final GroupValidationResult validationResult = new GroupValidationResult(this);
 
 128         return validationResult;