本文整理匯總了Java中reactor.core.publisher.Flux.empty方法的典型用法代碼示例。如果您正苦於以下問題:Java Flux.empty方法的具體用法?Java Flux.empty怎麽用?Java Flux.empty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類reactor.core.publisher.Flux
的用法示例。
在下文中一共展示了Flux.empty方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findAllImages
import reactor.core.publisher.Flux; //導入方法依賴的package包/類
public Flux<Image> findAllImages() {
try {
return Flux.fromIterable(
Files.newDirectoryStream(Paths.get(UPLOAD_ROOT)))
.map(path ->
new Image(path.hashCode(),
path.getFileName().toString()));
} catch (IOException e) {
return Flux.empty();
}
}
示例2: apply
import reactor.core.publisher.Flux; //導入方法依賴的package包/類
protected Flux<?> apply(Flux<?> input) {
if (this.function != null) {
return function.apply(input);
}
if (this.consumer != null) {
this.consumer.accept(input);
return Flux.empty();
}
if (this.supplier != null) {
return this.supplier.get();
}
throw new IllegalStateException("No function defined");
}
示例3: getConfigAttributes
import reactor.core.publisher.Flux; //導入方法依賴的package包/類
public Flux<ConfigAttribute> getConfigAttributes(ServerWebExchange exchange) {
for(Map.Entry<ServerWebExchangeMatcher,SecurityConfig> entry : mappings.entrySet()) {
if(entry.getKey().matches(exchange).isMatch()) {
return Flux.just(entry.getValue());
}
}
return Flux.empty();
}
示例4: convertToFlux
import reactor.core.publisher.Flux; //導入方法依賴的package包/類
private Flux<?> convertToFlux(Object[] params) {
if (params.length == 0) {
return Flux.empty();
}
Object firstParam = params[0];
if (firstParam instanceof Collection){
return Flux.fromIterable((Collection) firstParam);
}
return Flux.just(firstParam);
}
示例5: emptyFlux
import reactor.core.publisher.Flux; //導入方法依賴的package包/類
Flux<String> emptyFlux() {
return Flux.empty();
}
示例6: getEmptyFluxStream
import reactor.core.publisher.Flux; //導入方法依賴的package包/類
@Override
public Flux<Employee> getEmptyFluxStream() {
Flux<Employee> empListEmpty = Flux.empty();
return empListEmpty;
}
示例7: getAccessCertificates
import reactor.core.publisher.Flux; //導入方法依賴的package包/類
@Override
@Transactional
public Flux<SignedAccessCertificateResource> getAccessCertificates(DeviceNonceAuthentication nonceAuthentication) {
requireNonNull(nonceAuthentication, "`nonceAuthentication` must not be null");
DeviceEntity device = deviceRepository.findBySerialNumber(nonceAuthentication.getDeviceSerialNumber())
.orElseThrow(() -> new NotFoundException("DeviceEntity not found"));
verifyNonceAuthOrThrow(nonceAuthentication, device.getPublicKey());
List<AccessCertificateEntity> accessCertificates = findValidAndRemoveExpired(device);
if (!device.isEnabled()) {
log.info("Removing {} access certificates for disabled device {}", accessCertificates.size(), device.getId());
// remove access certificates for disabled devices instead of throwing error
// so the device certificates will be removed from the device.
accessCertificateRepository.delete(accessCertificates);
return Flux.empty();
}
Map<Long, VehicleEntity> vehicles = fetchVehicles(accessCertificates);
return Flux.fromIterable(accessCertificates)
.map(accessCertificateEntity -> {
VehicleEntity vehicle = vehicles.get(accessCertificateEntity.getVehicleId());
SignedAccessCertificateImpl signedAccessCertificate = SignedAccessCertificateImpl.builder()
.deviceAccessCertificateBase64(accessCertificateEntity
.getDeviceAccessCertificateBase64())
.deviceAccessCertificateSignatureBase64(accessCertificateEntity
.getDeviceAccessCertificateSignatureBase64()
.orElseThrow(IllegalStateException::new))
.signedDeviceAccessCertificateBase64(accessCertificateEntity
.getSignedDeviceAccessCertificateBase64()
.orElseThrow(IllegalStateException::new))
.vehicleAccessCertificateBase64(accessCertificateEntity
.getVehicleAccessCertificateBase64())
.vehicleAccessCertificateSignatureBase64(accessCertificateEntity
.getVehicleAccessCertificateSignatureBase64()
.orElseThrow(IllegalStateException::new))
.signedVehicleAccessCertificateBase64(accessCertificateEntity
.getSignedVehicleAccessCertificateBase64()
.orElseThrow(IllegalStateException::new))
.build();
SignedAccessCertificateResource signedAccessCertificateResource = SignedAccessCertificateResourceImpl.builder()
.uuid(UUID.fromString(accessCertificateEntity.getUuid()))
.name(vehicle.getName())
.signedAccessCertificate(signedAccessCertificate)
.build();
return signedAccessCertificateResource;
});
}
示例8: invoke
import reactor.core.publisher.Flux; //導入方法依賴的package包/類
@Override
public Flux<?> invoke(Flux<?> arg) {
consumer.accept(arg);
return Flux.empty();
}