001
002package com.commercetools.api.models.extension;
003
004import java.util.*;
005
006import io.vrap.rmf.base.client.Builder;
007import io.vrap.rmf.base.client.utils.Generated;
008
009/**
010 * AuthorizationHeaderAuthenticationBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     AuthorizationHeaderAuthentication authorizationHeaderAuthentication = AuthorizationHeaderAuthentication.builder()
016 *             .headerValue("{headerValue}")
017 *             .build()
018 * </code></pre>
019 * </div>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class AuthorizationHeaderAuthenticationBuilder implements Builder<AuthorizationHeaderAuthentication> {
023
024    private String headerValue;
025
026    /**
027     *  <p>Partially hidden on retrieval for security reasons.</p>
028     * @param headerValue value to be set
029     * @return Builder
030     */
031
032    public AuthorizationHeaderAuthenticationBuilder headerValue(final String headerValue) {
033        this.headerValue = headerValue;
034        return this;
035    }
036
037    /**
038     *  <p>Partially hidden on retrieval for security reasons.</p>
039     * @return headerValue
040     */
041
042    public String getHeaderValue() {
043        return this.headerValue;
044    }
045
046    /**
047     * builds AuthorizationHeaderAuthentication with checking for non-null required values
048     * @return AuthorizationHeaderAuthentication
049     */
050    public AuthorizationHeaderAuthentication build() {
051        Objects.requireNonNull(headerValue, AuthorizationHeaderAuthentication.class + ": headerValue is missing");
052        return new AuthorizationHeaderAuthenticationImpl(headerValue);
053    }
054
055    /**
056     * builds AuthorizationHeaderAuthentication without checking for non-null required values
057     * @return AuthorizationHeaderAuthentication
058     */
059    public AuthorizationHeaderAuthentication buildUnchecked() {
060        return new AuthorizationHeaderAuthenticationImpl(headerValue);
061    }
062
063    /**
064     * factory method for an instance of AuthorizationHeaderAuthenticationBuilder
065     * @return builder
066     */
067    public static AuthorizationHeaderAuthenticationBuilder of() {
068        return new AuthorizationHeaderAuthenticationBuilder();
069    }
070
071    /**
072     * create builder for AuthorizationHeaderAuthentication instance
073     * @param template instance with prefilled values for the builder
074     * @return builder
075     */
076    public static AuthorizationHeaderAuthenticationBuilder of(final AuthorizationHeaderAuthentication template) {
077        AuthorizationHeaderAuthenticationBuilder builder = new AuthorizationHeaderAuthenticationBuilder();
078        builder.headerValue = template.getHeaderValue();
079        return builder;
080    }
081
082}