本文整理汇总了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();
}