package fr.umlv.shopping;

import java.util.Objects;

public record Book(String author, String title, int price) {
  public Book {
    if (price < 0) {
      throw new IllegalArgumentException("price < 0");
    }
    Objects.requireNonNull(author);
    Objects.requireNonNull(title);
  }

  @Override
  public String toString() {
    return title + ", de " + author;
  }
}
