header_b.setAttributesInOrder(this.attributes_list); header_b.setTriangles(SMFTriangles.of( this.triangle_count, this.triangle_size)); header_b.setVertexCount(this.vertex_count); header_b.setSchemaIdentifier(this.schema_id); header_b.setCoordinateSystem(this.coords); header_b.setMetaCount(this.meta_count); this.header = header_b.build(); super.events.onHeaderParsed(this.header); super.state.set(ParserState.STATE_HEADER_PARSED);
/** * Fill a builder with attribute values from the provided {@code SMFHeaderType} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(SMFHeaderType instance) { Objects.requireNonNull(instance, "instance"); setTriangles(instance.triangles()); setVertexCount(instance.vertexCount()); Optional<SMFSchemaIdentifier> schemaIdentifierOptional = instance.schemaIdentifier(); if (schemaIdentifierOptional.isPresent()) { setSchemaIdentifier(schemaIdentifierOptional); } setCoordinateSystem(instance.coordinateSystem()); setAttributesInOrder(instance.attributesInOrder()); return this; }
/** * Creates an immutable copy of a {@link SMFHeaderType} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable SMFHeader instance */ public static SMFHeader copyOf(SMFHeaderType instance) { if (instance instanceof SMFHeader) { return (SMFHeader) instance; } return SMFHeader.builder() .from(instance) .build(); }
/** * Creates an immutable copy of a {@link SMFHeaderType} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable SMFHeader instance */ public static SMFHeader copyOf(SMFHeaderType instance) { if (instance instanceof SMFHeader) { return (SMFHeader) instance; } return SMFHeader.builder() .from(instance) .build(); }
/** * Fill a builder with attribute values from the provided {@code SMFHeaderType} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(SMFHeaderType instance) { Objects.requireNonNull(instance, "instance"); setTriangles(instance.triangles()); setVertexCount(instance.vertexCount()); setSchemaIdentifier(instance.schemaIdentifier()); setCoordinateSystem(instance.coordinateSystem()); setAttributesInOrder(instance.attributesInOrder()); setMetaCount(instance.metaCount()); return this; }
/** * Creates a builder for {@link SMFHeader SMFHeader}. * @return A new SMFHeader builder */ public static SMFHeader.Builder builder() { return new SMFHeader.Builder(); }
/** * Creates a builder for {@link SMFHeader SMFHeader}. * @return A new SMFHeader builder */ public static SMFHeader.Builder builder() { return new SMFHeader.Builder(); }