package com.ruoyi.common.utils;

import java.util.Arrays;

public class ObjectUtils {
    public static boolean allFieldsNull(Object obj)  {
        if (obj == null) {
            return true;
        }

        return Arrays.stream(obj.getClass().getDeclaredFields())
                .peek(f -> f.setAccessible(true))
                .allMatch(f -> {
                    try {
                        return f.get(obj) == null;
                    } catch (IllegalAccessException e) {
                        return false;
                    }
                });
    }
}
