/**
 * JBoss, Home of Professional Open Source.
 * Copyright 2014-2019 Red Hat, Inc., and individual contributors
 * as indicated by the @author tags.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jboss.pnc.client;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import org.jboss.pnc.common.logging.MDCUtils;

import java.util.Map;

/**
 * @author <a href="mailto:matejonnet@gmail.com">Matej Lazar</a>
 */
@Data
@AllArgsConstructor
public class Configuration {

    private final String host;
    private final Integer port;

    private final BasicAuth basicAuth;

    private final String bearerToken;

    private final String protocol;

    /**
     * Fetch page size
     */
    private final int pageSize;

    /**
     * Define which values from the logging MDC are added as headers to the request.
     * A key is a MDC key.
     * A value is a header name
     */
    private Map<String, String> mdcToHeadersMappings;

    private Configuration(ConfigurationBuilder builder) {
        host = builder.host;
        port = builder.port;
        basicAuth = builder.basicAuth;
        bearerToken = builder.bearerToken;
        protocol = builder.protocol;
        pageSize = builder.pageSize;
        mdcToHeadersMappings = builder.mdcToHeadersMappings;
    }

    public static ConfigurationBuilder builder() {
        return new ConfigurationBuilder();
    }

    @Getter
    public static class BasicAuth {
        private String username;
        private String password;

        public BasicAuth(String username, String password) {
            this.username = username;
            this.password = password;
        }
    }

    public static final class ConfigurationBuilder {

        private String host;

        private Integer port;

        private BasicAuth basicAuth;

        private String bearerToken;

        private String protocol;

        private int pageSize;

        private Map<String, String> mdcToHeadersMappings;

        private ConfigurationBuilder() {
        }

        public ConfigurationBuilder host(String host) {
            this.host = host;
            return this;
        }

        public ConfigurationBuilder port(Integer port) {
            this.port = port;
            return this;
        }

        public ConfigurationBuilder basicAuth(BasicAuth basicAuth) {
            this.basicAuth = basicAuth;
            return this;
        }

        public ConfigurationBuilder bearerToken(String bearerToken) {
            this.bearerToken = bearerToken;
            return this;
        }

        public ConfigurationBuilder protocol(String protocol) {
            this.protocol = protocol;
            return this;
        }

        public ConfigurationBuilder pageSize(int pageSize) {
            this.pageSize = pageSize;
            return this;
        }

        public ConfigurationBuilder mdcToHeadersMappings(Map<String, String> mdcToHeadersMappings) {
            this.mdcToHeadersMappings = mdcToHeadersMappings;
            return this;
        }

        public ConfigurationBuilder addDefaultMdcToHeadersMappings() {
            this.mdcToHeadersMappings = MDCUtils.getMDCToHeaderMappings();
            return this;
        }

        public Configuration build() {
            return new Configuration(this);
        }
    }
}

@@ -767,16 +767,39 @@
 ructor;%0A
+import lombok.Builder;%0A
 import l
@@ -1001,16 +1001,25 @@
 tructor%0A
+@Builder%0A
 public c
@@ -1514,2090 +1514,384 @@
     
-private Configuration(ConfigurationBuilder builder) %7B%0A        host = builder.host;%0A        port = builder.port;%0A        basicAuth = builder.basicAuth;%0A        bearerToken = builder.bearerToken;%0A        protocol = builder.protocol;%0A        pageSize = builder.pageSize;%0A        mdcToHeadersMappings = builder.mdcToHeadersMappings;%0A    %7D%0A%0A    public static ConfigurationBuilder builder() %7B%0A        return new ConfigurationBuilder();%0A    %7D%0A%0A    @Getter%0A    public static class BasicAuth %7B%0A        private String username;%0A        private String password;%0A%0A        public BasicAuth(String username, String password) %7B%0A            this.username = username;%0A            this.password = password;%0A        %7D%0A    %7D%0A%0A    public static final class ConfigurationBuilder %7B%0A%0A        private String host;%0A%0A        private Integer port;%0A%0A        private BasicAuth basicAuth;%0A%0A        private String bearerToken;%0A%0A        private String protocol;%0A%0A        private int pageSize;%0A%0A        private Map%3CString, String%3E mdcToHeadersMappings;%0A%0A        private ConfigurationBuilder() %7B%0A        %7D%0A%0A        public ConfigurationBuilder host(String host) %7B%0A            this.host = host;%0A            return this;%0A        %7D%0A%0A        public ConfigurationBuilder port(Integer port) %7B%0A            this.port = port;%0A            return this;%0A        %7D%0A%0A        public ConfigurationBuilder basicAuth(BasicAuth basicAuth) %7B%0A            this.basicAuth = basicAuth;%0A            return this;%0A        %7D%0A%0A        public ConfigurationBuilder bearerToken(String bearerToken) %7B%0A            this.bearerToken = bearerToken;%0A            return this;%0A        %7D%0A%0A        public ConfigurationBuilder protocol(String protocol) %7B%0A            this.protocol = protocol;%0A            return this;%0A        %7D%0A%0A        public ConfigurationBuilder pageSize(int pageSize) %7B%0A            this.pageSize = pageSize;%0A            return this;%0A        %7D%0A%0A        public ConfigurationBuilder mdcToHeadersMappings(Map%3CString, String%3E mdcToHeadersMappings) %7B%0A            this.mdcToHeadersMappings = mdcToHeadersMappings;%0A            return this;%0A        %7D
+@Getter%0A    public static class BasicAuth %7B%0A        private String username;%0A        private String password;%0A%0A        public BasicAuth(String username, String password) %7B%0A            this.username = username;%0A            this.password = password;%0A        %7D%0A    %7D%0A%0A    public static final class ConfigurationBuilder %7B%0A%0A        private Map%3CString, String%3E mdcToHeadersMappings;
 %0A%0A  
@@ -2072,102 +2072,8 @@
    %7D
-%0A%0A        public Configuration build() %7B%0A            return new Configuration(this);%0A        %7D
 %0A   

Use lombok builder and customize it.