class DeviceAllInfoResponse {

    /**
     * 设备基本信息
     */
    private DeviceInfo deviceInfo;

    /**
     * 设备真实状态
     */
    private DeviceState realState;

    /**
     * 设备上线时间
     */
    private long onlineTime;

    /**
     * 设备离线时间
     */
    private long offlineTime;

    /**
     * 元数据  属性id:属性值 映射
     */
    private Map<String, Object> properties;

    /**
     * 元数据  事件id:事件数量 映射
     */
    private Map<String, Integer> eventCounts;

    public static DeviceAllInfoResponse of(DeviceInfo deviceInfo, DeviceRunInfo deviceRunInfo) {<FILL_FUNCTION_BODY>}


    public DeviceAllInfoResponse ofProperties(List<DevicePropertiesEntity> properties) {
        this.setProperties(properties.stream().collect(Collectors.toMap(DevicePropertiesEntity::getProperty, DevicePropertiesEntity::getFormatValue)));
        return this;
    }

    public DeviceAllInfoResponse ofEventCounts(Map<String, Integer> eventCounts) {
        this.setEventCounts(eventCounts);
        return this;
    }
}

        DeviceAllInfoResponse info = new DeviceAllInfoResponse();
        info.setDeviceInfo(deviceInfo);
        info.setOfflineTime(deviceRunInfo.getOfflineTime());
        info.setOnlineTime(deviceRunInfo.getOnlineTime());
        info.setRealState(deviceRunInfo.getState());
        return info;
    
<no_super_class>