Class SMFAttribute.Builder

  • Enclosing class:
    SMFAttribute

    public static final class SMFAttribute.Builder
    extends java.lang.Object
    Builds instances of type SMFAttribute. 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 SMFAttribute.Builder from​(SMFAttributeType instance)
        Fill a builder with attribute values from the provided SMFAttributeType 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
      • setName

        public final SMFAttribute.Builder setName​(SMFAttributeName name)
        Initializes the value for the name attribute.
        Parameters:
        name - The value for name
        Returns:
        this builder for use in a chained invocation
      • setComponentType

        public final SMFAttribute.Builder setComponentType​(SMFComponentType componentType)
        Initializes the value for the componentType attribute.
        Parameters:
        componentType - The value for componentType
        Returns:
        this builder for use in a chained invocation
      • setComponentCount

        public final SMFAttribute.Builder setComponentCount​(int componentCount)
        Initializes the value for the componentCount attribute.
        Parameters:
        componentCount - The value for componentCount
        Returns:
        this builder for use in a chained invocation
      • setComponentSizeBits

        public final SMFAttribute.Builder setComponentSizeBits​(int componentSizeBits)
        Initializes the value for the componentSizeBits attribute.
        Parameters:
        componentSizeBits - The value for componentSizeBits
        Returns:
        this builder for use in a chained invocation
      • build

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