Skip to the content.
package com.bookshop.solid.lsp;

/**
 * Deliberately NOT {@link Purchasable}: a free sample has no price and cannot be
 * bought, so it doesn't claim the contract it can't keep. The type system now
 * prevents the LSP violation instead of a runtime exception punishing it.
 */
public record FreeSampleChapter(String title, String downloadUrl) {
}

Raw file