import java.io.Serializable;

/** Una canción. Se valida al crearla, también al deserializarla. */
public record Song(String title, String artist, int seconds) implements Serializable {
    public Song {
        if (title.isBlank()) {
            throw new IllegalArgumentException("título vacío");
        }
        if (seconds <= 0) {
            throw new IllegalArgumentException("duración inválida: " + seconds);
        }
    }
}
