<分区>
Restaurant responseRestaurant = restaurant_repository.findById(1L);
List<Queue> responseQueueList = queue_repository.findByRestaurantId(responseRestaurant);
我有这段代码以列表的形式返回响应,我想检查存储在“responseQueueList”中的值
<分区>
Restaurant responseRestaurant = restaurant_repository.findById(1L);
List<Queue> responseQueueList = queue_repository.findByRestaurantId(responseRestaurant);
我有这段代码以列表的形式返回响应,我想检查存储在“responseQueueList”中的值
最佳答案
如果程序在初始化 responseQueueList
行之后暂停,您只需将鼠标悬停在单词 responseQueueList
上即可查看其值及其引用的对象的字段到(及其字段,以及它们引用的对象,以及它们的字段等...)。
Eclipse 不会直接显示集合的内容,但会显示字段,您可以查看这些字段(例如,ArrayList
将其内容存储在引用的数组中字段 elementData
)。
如果这太不方便,您也可以尝试在表达式 View 中添加 responseQueueList.toString()
(Window -> Show View -> Expressions
或 窗口 -> 显示 View -> 其他... -> 调试 -> 表达式
)
关于java - 在 Eclipse 中调试 List<Class> 对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27838414/