class BasicDeviceOperator implements ConfigOperator {

    public static DeviceDescription combine(BasicDeviceConfig bdc, DeviceDescription descr) {
        if (bdc == null || descr == null) {
            return descr;
        }

        Device.Type type = descr.type();
        if (bdc.type() != null && bdc.type() != type) {
            type = bdc.type();
        }
        String manufacturer = descr.manufacturer();
        if (bdc.manufacturer() != null && !bdc.manufacturer().equals(manufacturer)) {
            manufacturer = bdc.manufacturer();
        }
        String hwVersion = descr.hwVersion();
        if (bdc.hwVersion() != null && !bdc.hwVersion().equals(hwVersion)) {
            hwVersion = bdc.hwVersion();
        }
        String swVersion = descr.swVersion();
        if (bdc.swVersion() != null && !bdc.swVersion().equals(swVersion)) {
            swVersion = bdc.swVersion();
        }
        String serial = descr.serialNumber();
        if (bdc.serial() != null && !bdc.serial().equals(serial)) {
            serial = bdc.serial();
        }

        SparseAnnotations sa = combine(bdc, descr.annotations());
        return new DefaultDeviceDescription(descr.deviceUri(), type, manufacturer,
                                            hwVersion, swVersion,
                                            serial, descr.chassisId(), sa);
    }

    private  BasicDeviceOperator();

}