Class SMFSchemaAttribute.Builder

  • Enclosing class:
    SMFSchemaAttribute

    public static final class SMFSchemaAttribute.Builder
    extends java.lang.Object
    Builds instances of type SMFSchemaAttribute. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Method Detail

      • from

        public final SMFSchemaAttribute.Builder from​(SMFSchemaAttributeType instance)
        Fill a builder with attribute values from the provided SMFSchemaAttributeType instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • setRequiredComponentType

        public final SMFSchemaAttribute.Builder setRequiredComponentType​(SMFComponentType requiredComponentType)
        Initializes the optional value requiredComponentType to requiredComponentType.
        Parameters:
        requiredComponentType - The value for requiredComponentType
        Returns:
        this builder for chained invocation
      • setRequiredComponentType

        public final SMFSchemaAttribute.Builder setRequiredComponentType​(java.util.Optional<? extends SMFComponentType> requiredComponentType)
        Initializes the optional value requiredComponentType to requiredComponentType.
        Parameters:
        requiredComponentType - The value for requiredComponentType
        Returns:
        this builder for use in a chained invocation
      • setRequiredComponentCount

        public final SMFSchemaAttribute.Builder setRequiredComponentCount​(int requiredComponentCount)
        Initializes the optional value requiredComponentCount to requiredComponentCount.
        Parameters:
        requiredComponentCount - The value for requiredComponentCount
        Returns:
        this builder for chained invocation
      • setRequiredComponentCount

        public final SMFSchemaAttribute.Builder setRequiredComponentCount​(java.util.OptionalInt requiredComponentCount)
        Initializes the optional value requiredComponentCount to requiredComponentCount.
        Parameters:
        requiredComponentCount - The value for requiredComponentCount
        Returns:
        this builder for use in a chained invocation
      • setRequiredComponentSize

        public final SMFSchemaAttribute.Builder setRequiredComponentSize​(int requiredComponentSize)
        Initializes the optional value requiredComponentSize to requiredComponentSize.
        Parameters:
        requiredComponentSize - The value for requiredComponentSize
        Returns:
        this builder for chained invocation
      • setRequiredComponentSize

        public final SMFSchemaAttribute.Builder setRequiredComponentSize​(java.util.OptionalInt requiredComponentSize)
        Initializes the optional value requiredComponentSize to requiredComponentSize.
        Parameters:
        requiredComponentSize - The value for requiredComponentSize
        Returns:
        this builder for use in a chained invocation
      • build

        public SMFSchemaAttribute build()
        Builds a new SMFSchemaAttribute.
        Returns:
        An immutable instance of SMFSchemaAttribute
        Throws:
        java.lang.IllegalStateException - if any required attributes are missing