withSchema method

Encoding withSchema(
  1. String schema
)

Returns a copy of this encoding carrying schema as its schema.

Value-style: this Encoding is left unchanged and a new one is returned. mimeType is carried over untouched -- the two wire channels are independent.

schema is a non-nullable positional String, by CONV-2b (one entry point, one parameter -> a parameter, not an options class) and because there is no "canon decides" case when a caller is explicitly setting a schema. Passing '' sets the present-but-empty state, which is a real canon state distinct from absent (R-4); to express absent, do not call this method at all.

Implementation

Encoding withSchema(String schema) => Encoding._(mimeType, schema);