change

fun change(oldDeviceIdentifier: String, newDevice: DevicePrimitives)

Updates a Device with the given identifier with the newDevice primitives.

Return

The new saved instance of Device

Throws

if the new device id from the primitives or the old device identifier isn't valid

if the id of the new device is already used on the repository

if the old device identifier doesn't exist on the repository

if the new device content is the same as the old one (doesn't compare the identifier, only the content)

if the new name isn't valid