/** * Excludes one device from the collection. * @param device Device to exclude. * @return The filtered collection. */ public final DevicesInPortal excludeDevice(Device device) { checkNotNull(device, "Null devices not allowed"); if (!containsDevice(device)) { return this; } if (size() == 1) { return EMPTY; } return new Filter(this, Predicates.compose(not(equalTo(device)), DeviceInPortal.DEVICE)); }
/** * Excludes one device from the collection. * @param deviceId Device id to exclude. * @return The filtered collection. */ public final DevicesInPortal excludeDeviceId(UUID deviceId) { checkNotNull(deviceId, "Null devices not allowed"); if (!containsDeviceId(deviceId)) { return this; } if (size() == 1) { return EMPTY; } return new Filter(this, Predicates.compose(not(equalTo(deviceId)), Functions.compose(Device.ID, DeviceInPortal.DEVICE))); }