/** * Fill this modifiable instance with attribute values from the provided {@link JCGLClearSpecificationType} instance. * Regular attribute values will be overridden, i.e. replaced with ones of an instance. * Any of the instance's absent optional values will not be copied (will not override current values). * @param instance The instance from which to copy values * @return {@code this} for use in a chained invocation */ public JCGLClearSpecificationMutable from(JCGLClearSpecificationType instance) { Objects.requireNonNull(instance, "instance"); Optional<Vector4D> colorBufferClearOptional = instance.colorBufferClear(); if (colorBufferClearOptional.isPresent()) { setColorBufferClear(colorBufferClearOptional); } OptionalDouble depthBufferClearOptional = instance.depthBufferClear(); if (depthBufferClearOptional.isPresent()) { setDepthBufferClear(depthBufferClearOptional); } OptionalInt stencilBufferClearOptional = instance.stencilBufferClear(); if (stencilBufferClearOptional.isPresent()) { setStencilBufferClear(stencilBufferClearOptional); } setStrictChecking(instance.strictChecking()); return this; }
/** * Fill a builder with attribute values from the provided {@code JCGLClearSpecificationType} 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(JCGLClearSpecificationType instance) { Objects.requireNonNull(instance, "instance"); Optional<Vector4D> colorBufferClearOptional = instance.colorBufferClear(); if (colorBufferClearOptional.isPresent()) { setColorBufferClear(colorBufferClearOptional); } OptionalDouble depthBufferClearOptional = instance.depthBufferClear(); if (depthBufferClearOptional.isPresent()) { setDepthBufferClear(depthBufferClearOptional); } OptionalInt stencilBufferClearOptional = instance.stencilBufferClear(); if (stencilBufferClearOptional.isPresent()) { setStencilBufferClear(stencilBufferClearOptional); } setStrictChecking(instance.strictChecking()); return this; }
final OptionalDouble opt_depth = c.depthBufferClear(); final OptionalInt opt_stencil = c.stencilBufferClear();