Class SMFHeader.Builder

  • Enclosing class:
    SMFHeader

    public static final class SMFHeader.Builder
    extends java.lang.Object
    Builds instances of type SMFHeader. 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 SMFHeader.Builder from​(SMFHeaderType instance)
        Fill a builder with attribute values from the provided SMFHeaderType instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • setTriangles

        public final SMFHeader.Builder setTriangles​(SMFTriangles triangles)
        Initializes the value for the triangles attribute.

        If not set, this attribute will have a default value as returned by the initializer of triangles.

        Parameters:
        triangles - The value for triangles
        Returns:
        this builder for use in a chained invocation
      • setVertexCount

        public final SMFHeader.Builder setVertexCount​(long vertexCount)
        Initializes the value for the vertexCount attribute.

        If not set, this attribute will have a default value as returned by the initializer of vertexCount.

        Parameters:
        vertexCount - The value for vertexCount
        Returns:
        this builder for use in a chained invocation
      • setSchemaIdentifier

        public final SMFHeader.Builder setSchemaIdentifier​(SMFSchemaIdentifier schemaIdentifier)
        Initializes the optional value schemaIdentifier to schemaIdentifier.
        Parameters:
        schemaIdentifier - The value for schemaIdentifier
        Returns:
        this builder for chained invocation
      • setSchemaIdentifier

        public final SMFHeader.Builder setSchemaIdentifier​(java.util.Optional<? extends SMFSchemaIdentifier> schemaIdentifier)
        Initializes the optional value schemaIdentifier to schemaIdentifier.
        Parameters:
        schemaIdentifier - The value for schemaIdentifier
        Returns:
        this builder for use in a chained invocation
      • setCoordinateSystem

        public final SMFHeader.Builder setCoordinateSystem​(SMFCoordinateSystem coordinateSystem)
        Initializes the value for the coordinateSystem attribute.

        If not set, this attribute will have a default value as returned by the initializer of coordinateSystem.

        Parameters:
        coordinateSystem - The value for coordinateSystem
        Returns:
        this builder for use in a chained invocation
      • setDataByteOrder

        public final SMFHeader.Builder setDataByteOrder​(java.nio.ByteOrder dataByteOrder)
        Initializes the value for the dataByteOrder attribute.

        If not set, this attribute will have a default value as returned by the initializer of dataByteOrder.

        Parameters:
        dataByteOrder - The value for dataByteOrder
        Returns:
        this builder for use in a chained invocation
      • addAttributesInOrder

        public final SMFHeader.Builder addAttributesInOrder​(SMFAttribute element)
        Adds one element to attributesInOrder list.
        Parameters:
        element - A attributesInOrder element
        Returns:
        this builder for use in a chained invocation
      • addAttributesInOrder

        public final SMFHeader.Builder addAttributesInOrder​(SMFAttribute... elements)
        Adds elements to attributesInOrder list.
        Parameters:
        elements - An array of attributesInOrder elements
        Returns:
        this builder for use in a chained invocation
      • setAttributesInOrder

        public final SMFHeader.Builder setAttributesInOrder​(java.lang.Iterable<? extends SMFAttribute> elements)
        Sets or replaces all elements for attributesInOrder list.
        Parameters:
        elements - An iterable of attributesInOrder elements
        Returns:
        this builder for use in a chained invocation
      • addAllAttributesInOrder

        public final SMFHeader.Builder addAllAttributesInOrder​(java.lang.Iterable<? extends SMFAttribute> elements)
        Adds elements to attributesInOrder list.
        Parameters:
        elements - An iterable of attributesInOrder elements
        Returns:
        this builder for use in a chained invocation
      • build

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