All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.elasticbeanstalk.model.ConfigurationOptionDescription Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Elastic Beanstalk module holds the client classes that are used for communicating with AWS Elastic Beanstalk Service

There is a newer version: 2.28.3
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file 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 software.amazon.awssdk.services.elasticbeanstalk.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes the possible values for a configuration option. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ConfigurationOptionDescription implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAMESPACE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Namespace").getter(getter(ConfigurationOptionDescription::namespace)).setter(setter(Builder::namespace)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Namespace").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(ConfigurationOptionDescription::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField DEFAULT_VALUE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DefaultValue").getter(getter(ConfigurationOptionDescription::defaultValue)) .setter(setter(Builder::defaultValue)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultValue").build()).build(); private static final SdkField CHANGE_SEVERITY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ChangeSeverity").getter(getter(ConfigurationOptionDescription::changeSeverity)) .setter(setter(Builder::changeSeverity)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeSeverity").build()).build(); private static final SdkField USER_DEFINED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("UserDefined").getter(getter(ConfigurationOptionDescription::userDefined)) .setter(setter(Builder::userDefined)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserDefined").build()).build(); private static final SdkField VALUE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ValueType").getter(getter(ConfigurationOptionDescription::valueTypeAsString)) .setter(setter(Builder::valueType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValueType").build()).build(); private static final SdkField> VALUE_OPTIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("ValueOptions") .getter(getter(ConfigurationOptionDescription::valueOptions)) .setter(setter(Builder::valueOptions)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValueOptions").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField MIN_VALUE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("MinValue").getter(getter(ConfigurationOptionDescription::minValue)).setter(setter(Builder::minValue)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MinValue").build()).build(); private static final SdkField MAX_VALUE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("MaxValue").getter(getter(ConfigurationOptionDescription::maxValue)).setter(setter(Builder::maxValue)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxValue").build()).build(); private static final SdkField MAX_LENGTH_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("MaxLength").getter(getter(ConfigurationOptionDescription::maxLength)).setter(setter(Builder::maxLength)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxLength").build()).build(); private static final SdkField REGEX_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Regex") .getter(getter(ConfigurationOptionDescription::regex)).setter(setter(Builder::regex)) .constructor(OptionRestrictionRegex::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Regex").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAMESPACE_FIELD, NAME_FIELD, DEFAULT_VALUE_FIELD, CHANGE_SEVERITY_FIELD, USER_DEFINED_FIELD, VALUE_TYPE_FIELD, VALUE_OPTIONS_FIELD, MIN_VALUE_FIELD, MAX_VALUE_FIELD, MAX_LENGTH_FIELD, REGEX_FIELD)); private static final long serialVersionUID = 1L; private final String namespace; private final String name; private final String defaultValue; private final String changeSeverity; private final Boolean userDefined; private final String valueType; private final List valueOptions; private final Integer minValue; private final Integer maxValue; private final Integer maxLength; private final OptionRestrictionRegex regex; private ConfigurationOptionDescription(BuilderImpl builder) { this.namespace = builder.namespace; this.name = builder.name; this.defaultValue = builder.defaultValue; this.changeSeverity = builder.changeSeverity; this.userDefined = builder.userDefined; this.valueType = builder.valueType; this.valueOptions = builder.valueOptions; this.minValue = builder.minValue; this.maxValue = builder.maxValue; this.maxLength = builder.maxLength; this.regex = builder.regex; } /** *

* A unique namespace identifying the option's associated AWS resource. *

* * @return A unique namespace identifying the option's associated AWS resource. */ public final String namespace() { return namespace; } /** *

* The name of the configuration option. *

* * @return The name of the configuration option. */ public final String name() { return name; } /** *

* The default value for this configuration option. *

* * @return The default value for this configuration option. */ public final String defaultValue() { return defaultValue; } /** *

* An indication of which action is required if the value for this configuration option changes: *

*
    *
  • *

    * NoInterruption : There is no interruption to the environment or application availability. *

    *
  • *
  • *

    * RestartEnvironment : The environment is entirely restarted, all AWS resources are deleted and * recreated, and the environment is unavailable during the process. *

    *
  • *
  • *

    * RestartApplicationServer : The environment is available the entire time. However, a short * application outage occurs when the application servers on the running Amazon EC2 instances are restarted. *

    *
  • *
* * @return An indication of which action is required if the value for this configuration option changes:

*
    *
  • *

    * NoInterruption : There is no interruption to the environment or application availability. *

    *
  • *
  • *

    * RestartEnvironment : The environment is entirely restarted, all AWS resources are deleted * and recreated, and the environment is unavailable during the process. *

    *
  • *
  • *

    * RestartApplicationServer : The environment is available the entire time. However, a short * application outage occurs when the application servers on the running Amazon EC2 instances are restarted. *

    *
  • */ public final String changeSeverity() { return changeSeverity; } /** *

    * An indication of whether the user defined this configuration option: *

    *
      *
    • *

      * true : This configuration option was defined by the user. It is a valid choice for specifying if * this as an Option to Remove when updating configuration settings. *

      *
    • *
    • *

      * false : This configuration was not defined by the user. *

      *
    • *
    *

    * Constraint: You can remove only UserDefined options from a configuration. *

    *

    * Valid Values: true | false *

    * * @return An indication of whether the user defined this configuration option:

    *
      *
    • *

      * true : This configuration option was defined by the user. It is a valid choice for * specifying if this as an Option to Remove when updating configuration settings. *

      *
    • *
    • *

      * false : This configuration was not defined by the user. *

      *
    • *
    *

    * Constraint: You can remove only UserDefined options from a configuration. *

    *

    * Valid Values: true | false */ public final Boolean userDefined() { return userDefined; } /** *

    * An indication of which type of values this option has and whether it is allowable to select one or more than one * of the possible values: *

    *
      *
    • *

      * Scalar : Values for this option are a single selection from the possible values, or an unformatted * string, or numeric value governed by the MIN/MAX/Regex constraints. *

      *
    • *
    • *

      * List : Values for this option are multiple selections from the possible values. *

      *
    • *
    • *

      * Boolean : Values for this option are either true or false . *

      *
    • *
    • *

      * Json : Values for this option are a JSON representation of a ConfigDocument. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #valueType} will * return {@link ConfigurationOptionValueType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #valueTypeAsString}. *

    * * @return An indication of which type of values this option has and whether it is allowable to select one or more * than one of the possible values:

    *
      *
    • *

      * Scalar : Values for this option are a single selection from the possible values, or an * unformatted string, or numeric value governed by the MIN/MAX/Regex constraints. *

      *
    • *
    • *

      * List : Values for this option are multiple selections from the possible values. *

      *
    • *
    • *

      * Boolean : Values for this option are either true or false . *

      *
    • *
    • *

      * Json : Values for this option are a JSON representation of a ConfigDocument. *

      *
    • * @see ConfigurationOptionValueType */ public final ConfigurationOptionValueType valueType() { return ConfigurationOptionValueType.fromValue(valueType); } /** *

      * An indication of which type of values this option has and whether it is allowable to select one or more than one * of the possible values: *

      *
        *
      • *

        * Scalar : Values for this option are a single selection from the possible values, or an unformatted * string, or numeric value governed by the MIN/MAX/Regex constraints. *

        *
      • *
      • *

        * List : Values for this option are multiple selections from the possible values. *

        *
      • *
      • *

        * Boolean : Values for this option are either true or false . *

        *
      • *
      • *

        * Json : Values for this option are a JSON representation of a ConfigDocument. *

        *
      • *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #valueType} will * return {@link ConfigurationOptionValueType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #valueTypeAsString}. *

      * * @return An indication of which type of values this option has and whether it is allowable to select one or more * than one of the possible values:

      *
        *
      • *

        * Scalar : Values for this option are a single selection from the possible values, or an * unformatted string, or numeric value governed by the MIN/MAX/Regex constraints. *

        *
      • *
      • *

        * List : Values for this option are multiple selections from the possible values. *

        *
      • *
      • *

        * Boolean : Values for this option are either true or false . *

        *
      • *
      • *

        * Json : Values for this option are a JSON representation of a ConfigDocument. *

        *
      • * @see ConfigurationOptionValueType */ public final String valueTypeAsString() { return valueType; } /** * Returns true if the ValueOptions property was specified by the sender (it may be empty), or false if the sender * did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public final boolean hasValueOptions() { return valueOptions != null && !(valueOptions instanceof SdkAutoConstructList); } /** *

        * If specified, values for the configuration option are selected from this list. *

        *

        * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

        *

        * You can use {@link #hasValueOptions()} to see if a value was sent in this field. *

        * * @return If specified, values for the configuration option are selected from this list. */ public final List valueOptions() { return valueOptions; } /** *

        * If specified, the configuration option must be a numeric value greater than this value. *

        * * @return If specified, the configuration option must be a numeric value greater than this value. */ public final Integer minValue() { return minValue; } /** *

        * If specified, the configuration option must be a numeric value less than this value. *

        * * @return If specified, the configuration option must be a numeric value less than this value. */ public final Integer maxValue() { return maxValue; } /** *

        * If specified, the configuration option must be a string value no longer than this value. *

        * * @return If specified, the configuration option must be a string value no longer than this value. */ public final Integer maxLength() { return maxLength; } /** *

        * If specified, the configuration option must be a string value that satisfies this regular expression. *

        * * @return If specified, the configuration option must be a string value that satisfies this regular expression. */ public final OptionRestrictionRegex regex() { return regex; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(namespace()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(defaultValue()); hashCode = 31 * hashCode + Objects.hashCode(changeSeverity()); hashCode = 31 * hashCode + Objects.hashCode(userDefined()); hashCode = 31 * hashCode + Objects.hashCode(valueTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasValueOptions() ? valueOptions() : null); hashCode = 31 * hashCode + Objects.hashCode(minValue()); hashCode = 31 * hashCode + Objects.hashCode(maxValue()); hashCode = 31 * hashCode + Objects.hashCode(maxLength()); hashCode = 31 * hashCode + Objects.hashCode(regex()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ConfigurationOptionDescription)) { return false; } ConfigurationOptionDescription other = (ConfigurationOptionDescription) obj; return Objects.equals(namespace(), other.namespace()) && Objects.equals(name(), other.name()) && Objects.equals(defaultValue(), other.defaultValue()) && Objects.equals(changeSeverity(), other.changeSeverity()) && Objects.equals(userDefined(), other.userDefined()) && Objects.equals(valueTypeAsString(), other.valueTypeAsString()) && hasValueOptions() == other.hasValueOptions() && Objects.equals(valueOptions(), other.valueOptions()) && Objects.equals(minValue(), other.minValue()) && Objects.equals(maxValue(), other.maxValue()) && Objects.equals(maxLength(), other.maxLength()) && Objects.equals(regex(), other.regex()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("ConfigurationOptionDescription").add("Namespace", namespace()).add("Name", name()) .add("DefaultValue", defaultValue()).add("ChangeSeverity", changeSeverity()).add("UserDefined", userDefined()) .add("ValueType", valueTypeAsString()).add("ValueOptions", hasValueOptions() ? valueOptions() : null) .add("MinValue", minValue()).add("MaxValue", maxValue()).add("MaxLength", maxLength()).add("Regex", regex()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Namespace": return Optional.ofNullable(clazz.cast(namespace())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "DefaultValue": return Optional.ofNullable(clazz.cast(defaultValue())); case "ChangeSeverity": return Optional.ofNullable(clazz.cast(changeSeverity())); case "UserDefined": return Optional.ofNullable(clazz.cast(userDefined())); case "ValueType": return Optional.ofNullable(clazz.cast(valueTypeAsString())); case "ValueOptions": return Optional.ofNullable(clazz.cast(valueOptions())); case "MinValue": return Optional.ofNullable(clazz.cast(minValue())); case "MaxValue": return Optional.ofNullable(clazz.cast(maxValue())); case "MaxLength": return Optional.ofNullable(clazz.cast(maxLength())); case "Regex": return Optional.ofNullable(clazz.cast(regex())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ConfigurationOptionDescription) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

        * A unique namespace identifying the option's associated AWS resource. *

        * * @param namespace * A unique namespace identifying the option's associated AWS resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder namespace(String namespace); /** *

        * The name of the configuration option. *

        * * @param name * The name of the configuration option. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

        * The default value for this configuration option. *

        * * @param defaultValue * The default value for this configuration option. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultValue(String defaultValue); /** *

        * An indication of which action is required if the value for this configuration option changes: *

        *
          *
        • *

          * NoInterruption : There is no interruption to the environment or application availability. *

          *
        • *
        • *

          * RestartEnvironment : The environment is entirely restarted, all AWS resources are deleted and * recreated, and the environment is unavailable during the process. *

          *
        • *
        • *

          * RestartApplicationServer : The environment is available the entire time. However, a short * application outage occurs when the application servers on the running Amazon EC2 instances are restarted. *

          *
        • *
        * * @param changeSeverity * An indication of which action is required if the value for this configuration option changes:

        *
          *
        • *

          * NoInterruption : There is no interruption to the environment or application availability. *

          *
        • *
        • *

          * RestartEnvironment : The environment is entirely restarted, all AWS resources are deleted * and recreated, and the environment is unavailable during the process. *

          *
        • *
        • *

          * RestartApplicationServer : The environment is available the entire time. However, a short * application outage occurs when the application servers on the running Amazon EC2 instances are * restarted. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. */ Builder changeSeverity(String changeSeverity); /** *

          * An indication of whether the user defined this configuration option: *

          *
            *
          • *

            * true : This configuration option was defined by the user. It is a valid choice for specifying if * this as an Option to Remove when updating configuration settings. *

            *
          • *
          • *

            * false : This configuration was not defined by the user. *

            *
          • *
          *

          * Constraint: You can remove only UserDefined options from a configuration. *

          *

          * Valid Values: true | false *

          * * @param userDefined * An indication of whether the user defined this configuration option:

          *
            *
          • *

            * true : This configuration option was defined by the user. It is a valid choice for * specifying if this as an Option to Remove when updating configuration settings. *

            *
          • *
          • *

            * false : This configuration was not defined by the user. *

            *
          • *
          *

          * Constraint: You can remove only UserDefined options from a configuration. *

          *

          * Valid Values: true | false * @return Returns a reference to this object so that method calls can be chained together. */ Builder userDefined(Boolean userDefined); /** *

          * An indication of which type of values this option has and whether it is allowable to select one or more than * one of the possible values: *

          *
            *
          • *

            * Scalar : Values for this option are a single selection from the possible values, or an * unformatted string, or numeric value governed by the MIN/MAX/Regex constraints. *

            *
          • *
          • *

            * List : Values for this option are multiple selections from the possible values. *

            *
          • *
          • *

            * Boolean : Values for this option are either true or false . *

            *
          • *
          • *

            * Json : Values for this option are a JSON representation of a ConfigDocument. *

            *
          • *
          * * @param valueType * An indication of which type of values this option has and whether it is allowable to select one or * more than one of the possible values:

          *
            *
          • *

            * Scalar : Values for this option are a single selection from the possible values, or an * unformatted string, or numeric value governed by the MIN/MAX/Regex constraints. *

            *
          • *
          • *

            * List : Values for this option are multiple selections from the possible values. *

            *
          • *
          • *

            * Boolean : Values for this option are either true or false . *

            *
          • *
          • *

            * Json : Values for this option are a JSON representation of a ConfigDocument. *

            *
          • * @see ConfigurationOptionValueType * @return Returns a reference to this object so that method calls can be chained together. * @see ConfigurationOptionValueType */ Builder valueType(String valueType); /** *

            * An indication of which type of values this option has and whether it is allowable to select one or more than * one of the possible values: *

            *
              *
            • *

              * Scalar : Values for this option are a single selection from the possible values, or an * unformatted string, or numeric value governed by the MIN/MAX/Regex constraints. *

              *
            • *
            • *

              * List : Values for this option are multiple selections from the possible values. *

              *
            • *
            • *

              * Boolean : Values for this option are either true or false . *

              *
            • *
            • *

              * Json : Values for this option are a JSON representation of a ConfigDocument. *

              *
            • *
            * * @param valueType * An indication of which type of values this option has and whether it is allowable to select one or * more than one of the possible values:

            *
              *
            • *

              * Scalar : Values for this option are a single selection from the possible values, or an * unformatted string, or numeric value governed by the MIN/MAX/Regex constraints. *

              *
            • *
            • *

              * List : Values for this option are multiple selections from the possible values. *

              *
            • *
            • *

              * Boolean : Values for this option are either true or false . *

              *
            • *
            • *

              * Json : Values for this option are a JSON representation of a ConfigDocument. *

              *
            • * @see ConfigurationOptionValueType * @return Returns a reference to this object so that method calls can be chained together. * @see ConfigurationOptionValueType */ Builder valueType(ConfigurationOptionValueType valueType); /** *

              * If specified, values for the configuration option are selected from this list. *

              * * @param valueOptions * If specified, values for the configuration option are selected from this list. * @return Returns a reference to this object so that method calls can be chained together. */ Builder valueOptions(Collection valueOptions); /** *

              * If specified, values for the configuration option are selected from this list. *

              * * @param valueOptions * If specified, values for the configuration option are selected from this list. * @return Returns a reference to this object so that method calls can be chained together. */ Builder valueOptions(String... valueOptions); /** *

              * If specified, the configuration option must be a numeric value greater than this value. *

              * * @param minValue * If specified, the configuration option must be a numeric value greater than this value. * @return Returns a reference to this object so that method calls can be chained together. */ Builder minValue(Integer minValue); /** *

              * If specified, the configuration option must be a numeric value less than this value. *

              * * @param maxValue * If specified, the configuration option must be a numeric value less than this value. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxValue(Integer maxValue); /** *

              * If specified, the configuration option must be a string value no longer than this value. *

              * * @param maxLength * If specified, the configuration option must be a string value no longer than this value. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxLength(Integer maxLength); /** *

              * If specified, the configuration option must be a string value that satisfies this regular expression. *

              * * @param regex * If specified, the configuration option must be a string value that satisfies this regular expression. * @return Returns a reference to this object so that method calls can be chained together. */ Builder regex(OptionRestrictionRegex regex); /** *

              * If specified, the configuration option must be a string value that satisfies this regular expression. *

              * This is a convenience that creates an instance of the {@link OptionRestrictionRegex.Builder} avoiding the * need to create one manually via {@link OptionRestrictionRegex#builder()}. * * When the {@link Consumer} completes, {@link OptionRestrictionRegex.Builder#build()} is called immediately and * its result is passed to {@link #regex(OptionRestrictionRegex)}. * * @param regex * a consumer that will call methods on {@link OptionRestrictionRegex.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #regex(OptionRestrictionRegex) */ default Builder regex(Consumer regex) { return regex(OptionRestrictionRegex.builder().applyMutation(regex).build()); } } static final class BuilderImpl implements Builder { private String namespace; private String name; private String defaultValue; private String changeSeverity; private Boolean userDefined; private String valueType; private List valueOptions = DefaultSdkAutoConstructList.getInstance(); private Integer minValue; private Integer maxValue; private Integer maxLength; private OptionRestrictionRegex regex; private BuilderImpl() { } private BuilderImpl(ConfigurationOptionDescription model) { namespace(model.namespace); name(model.name); defaultValue(model.defaultValue); changeSeverity(model.changeSeverity); userDefined(model.userDefined); valueType(model.valueType); valueOptions(model.valueOptions); minValue(model.minValue); maxValue(model.maxValue); maxLength(model.maxLength); regex(model.regex); } public final String getNamespace() { return namespace; } @Override public final Builder namespace(String namespace) { this.namespace = namespace; return this; } public final void setNamespace(String namespace) { this.namespace = namespace; } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final String getDefaultValue() { return defaultValue; } @Override public final Builder defaultValue(String defaultValue) { this.defaultValue = defaultValue; return this; } public final void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; } public final String getChangeSeverity() { return changeSeverity; } @Override public final Builder changeSeverity(String changeSeverity) { this.changeSeverity = changeSeverity; return this; } public final void setChangeSeverity(String changeSeverity) { this.changeSeverity = changeSeverity; } public final Boolean getUserDefined() { return userDefined; } @Override public final Builder userDefined(Boolean userDefined) { this.userDefined = userDefined; return this; } public final void setUserDefined(Boolean userDefined) { this.userDefined = userDefined; } public final String getValueType() { return valueType; } @Override public final Builder valueType(String valueType) { this.valueType = valueType; return this; } @Override public final Builder valueType(ConfigurationOptionValueType valueType) { this.valueType(valueType == null ? null : valueType.toString()); return this; } public final void setValueType(String valueType) { this.valueType = valueType; } public final Collection getValueOptions() { if (valueOptions instanceof SdkAutoConstructList) { return null; } return valueOptions; } @Override public final Builder valueOptions(Collection valueOptions) { this.valueOptions = ConfigurationOptionPossibleValuesCopier.copy(valueOptions); return this; } @Override @SafeVarargs public final Builder valueOptions(String... valueOptions) { valueOptions(Arrays.asList(valueOptions)); return this; } public final void setValueOptions(Collection valueOptions) { this.valueOptions = ConfigurationOptionPossibleValuesCopier.copy(valueOptions); } public final Integer getMinValue() { return minValue; } @Override public final Builder minValue(Integer minValue) { this.minValue = minValue; return this; } public final void setMinValue(Integer minValue) { this.minValue = minValue; } public final Integer getMaxValue() { return maxValue; } @Override public final Builder maxValue(Integer maxValue) { this.maxValue = maxValue; return this; } public final void setMaxValue(Integer maxValue) { this.maxValue = maxValue; } public final Integer getMaxLength() { return maxLength; } @Override public final Builder maxLength(Integer maxLength) { this.maxLength = maxLength; return this; } public final void setMaxLength(Integer maxLength) { this.maxLength = maxLength; } public final OptionRestrictionRegex.Builder getRegex() { return regex != null ? regex.toBuilder() : null; } @Override public final Builder regex(OptionRestrictionRegex regex) { this.regex = regex; return this; } public final void setRegex(OptionRestrictionRegex.BuilderImpl regex) { this.regex = regex != null ? regex.build() : null; } @Override public ConfigurationOptionDescription build() { return new ConfigurationOptionDescription(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy