private Device find(DeviceNameUse use, String name) { final DevicesInPortal dips = filterByUse(use); if (dips.containsName(name)) { return dips.getByName(name).getDevice(); } return null; }
static Route toDevice(RenderContext context, Route route, String deviceName) { if (deviceName == null) { return route; } final DevicesInPortal dips = context.getPortal().getDevices(); if (dips.containsName(deviceName)) { final DeviceInPortal dip = dips.getByName(deviceName); return route.toDevice(dip.getDevice()); } return route; }