📅  最后修改于: 2022-03-11 14:52:43.248000             🧑  作者: Mango
public boolean doesObjectContainField(Object object, String fieldName) {
return Arrays.stream(object.getClass().getFields())
.anyMatch(f -> f.getName().equals(fieldName));
}