Part

@Serializable(with = Part.Serializer::class)
data class Part(val title: String, val summary: String, val first: Int, val last: Int, short: String? = null)(source)

A run of pieces a work is divided into: a group of sonnets, a chapter, an act.

Creating a part directly does not validate it against a work.

Throws

when the part does not start at piece one or later, or ends before it starts.

naming the field when a bound decoded from YAML or JSON is not a whole number within 32 bits.

naming the field when a decoded title or summary is null; a null short is read as none.

when a decoded part misses a field or a field holds another kind of value than it names.

Constructors

Link copied to clipboard
constructor(title: String, summary: String, first: Int, last: Int, short: String? = null)

Properties

Link copied to clipboard
val first: Int

Number of the first piece in the part.

Link copied to clipboard
val id: Int

Stable identity, equal to the first piece number.

Link copied to clipboard
val last: Int

Number of the last piece in the part.

Link copied to clipboard

Inclusive piece-number range occupied by the part.

Link copied to clipboard

Compact title when one was supplied, otherwise title.

Link copied to clipboard

Reader-facing account of what the part contains.

Link copied to clipboard

Full title shown when the part is introduced.

Functions

Link copied to clipboard
fun contains(piece: Int): Boolean

Reports whether a numbered piece belongs to the part.