public D[] findDevices(ServiceType serviceType) { return toDeviceArray(find(serviceType, (D) this)); }
public D[] findDevices(DeviceType deviceType) { return toDeviceArray(find(deviceType, (D) this)); }
protected Collection<D> find(DeviceType deviceType, D current) { Collection<D> devices = new HashSet<>(); // Type might be null if we just discovered the device and it hasn't yet been hydrated if (current.getType() != null && current.getType().implementsVersion(deviceType)) { devices.add(current); } if (current.hasEmbeddedDevices()) { for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) { devices.addAll(find(deviceType, embeddedDevice)); } } return devices; }
protected D find(UDN udn, D current) { if (current.getIdentity() != null && current.getIdentity().getUdn() != null) { if (current.getIdentity().getUdn().equals(udn)) return current; } if (current.hasEmbeddedDevices()) { for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) { D match; if ((match = find(udn, embeddedDevice)) != null) return match; } } return null; }
public D[] findDevices(ServiceType serviceType) { return toDeviceArray(find(serviceType, (D) this)); }
public D[] findDevices(DeviceType deviceType) { return toDeviceArray(find(deviceType, (D) this)); }
protected Collection<D> find(DeviceType deviceType, D current) { Collection<D> devices = new HashSet(); // Type might be null if we just discovered the device and it hasn't yet been hydrated if (current.getType() != null && current.getType().implementsVersion(deviceType)) { devices.add(current); } if (current.hasEmbeddedDevices()) { for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) { devices.addAll(find(deviceType, embeddedDevice)); } } return devices; }
protected D find(UDN udn, D current) { if (current.getIdentity().getUdn().equals(udn)) return current; if (current.hasEmbeddedDevices()) { for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) { D match; if ((match = find(udn, embeddedDevice)) != null) return match; } } return null; }
public D[] findDevices(ServiceType serviceType) { return toDeviceArray(find(serviceType, (D) this)); }
public D[] findDevices(DeviceType deviceType) { return toDeviceArray(find(deviceType, (D) this)); }
protected Collection<D> find(DeviceType deviceType, D current) { Collection<D> devices = new HashSet<>(); // Type might be null if we just discovered the device and it hasn't yet been hydrated if (current.getType() != null && current.getType().implementsVersion(deviceType)) { devices.add(current); } if (current.hasEmbeddedDevices()) { for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) { devices.addAll(find(deviceType, embeddedDevice)); } } return devices; }
protected D find(UDN udn, D current) { if (current.getIdentity() != null && current.getIdentity().getUdn() != null) { if (current.getIdentity().getUdn().equals(udn)) return current; } if (current.hasEmbeddedDevices()) { for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) { D match; if ((match = find(udn, embeddedDevice)) != null) return match; } } return null; }