private GBDevice toGBDevice(Device dbDevice){
  DeviceType deviceType=DeviceType.fromKey(dbDevice.getType());
  GBDevice gbDevice=new GBDevice(dbDevice.getIdentifier(),dbDevice.getName(),deviceType);
  List<DeviceAttributes> deviceAttributesList=dbDevice.getDeviceAttributesList();
  if (deviceAttributesList.size() > 0) {
    gbDevice.setModel(dbDevice.getModel());
    DeviceAttributes attrs=deviceAttributesList.get(0);
    gbDevice.setFirmwareVersion(attrs.getFirmwareVersion1());
    gbDevice.setFirmwareVersion2(attrs.getFirmwareVersion2());
  }
  return gbDevice;
}

private GBDevice toGBDevice ( Device dbDevice ) { DeviceType deviceType = DeviceType . fromKey ( dbDevice . getType ( ) ) ; GBDevice gbDevice = new GBDevice ( dbDevice . getIdentifier ( ) , dbDevice . getName ( ) , deviceType ) ; List < DeviceAttributes > deviceAttributesList = dbDevice . getDeviceAttributesList ( ) ; if ( deviceAttributesList . size ( ) > 0 ) { gbDevice . setModel ( dbDevice . getModel ( ) ) ; DeviceAttributes attrs = deviceAttributesList . get ( 0 ) ; gbDevice . setFirmwareVersion ( attrs . getFirmwareVersion1 ( ) ) ; gbDevice . setFirmwareVersion2 ( attrs . getFirmwareVersion2 ( ) ) ; } return gbDevice ; }
converts a known device from the database to a gbdevice . note : the device might not be supported anymore , so callers should verify that .
