withReadOnly

abstract fun withReadOnly(): Header

Marks this header as read-only and returns it for method chaining.

After calling this method, the header becomes immutable and any subsequent modification attempts will throw UnsupportedOperationException. This method enables fluent API usage for marking headers as read-only.

Return

This header instance (now read-only) to support method chaining

Samples