Add Nullability support into Java DSL

This commit is contained in:
abilan
2023-04-14 14:16:36 -04:00
parent 053cc00484
commit d5181bf0d7
105 changed files with 514 additions and 366 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@ import org.springframework.integration.file.remote.session.SessionFactory;
import org.springframework.integration.file.support.FileExistsMode;
import org.springframework.integration.sftp.gateway.SftpOutboundGateway;
import org.springframework.integration.sftp.session.SftpRemoteFileTemplate;
import org.springframework.lang.Nullable;
/**
* The factory for SFTP components.
@@ -56,7 +57,7 @@ public final class Sftp {
* @return the spec.
*/
public static SftpInboundChannelAdapterSpec inboundAdapter(SessionFactory<SftpClient.DirEntry> sessionFactory,
Comparator<File> receptionOrderComparator) {
@Nullable Comparator<File> receptionOrderComparator) {
return new SftpInboundChannelAdapterSpec(sessionFactory, receptionOrderComparator);
}
@@ -82,7 +83,7 @@ public final class Sftp {
*/
public static SftpStreamingInboundChannelAdapterSpec inboundStreamingAdapter(
RemoteFileTemplate<SftpClient.DirEntry> remoteFileTemplate,
Comparator<SftpClient.DirEntry> receptionOrderComparator) {
@Nullable Comparator<SftpClient.DirEntry> receptionOrderComparator) {
return new SftpStreamingInboundChannelAdapterSpec(remoteFileTemplate, receptionOrderComparator);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@ import org.springframework.integration.sftp.filters.SftpRegexPatternFileListFilt
import org.springframework.integration.sftp.filters.SftpSimplePatternFileListFilter;
import org.springframework.integration.sftp.inbound.SftpInboundFileSynchronizer;
import org.springframework.integration.sftp.inbound.SftpInboundFileSynchronizingMessageSource;
import org.springframework.lang.Nullable;
/**
* A {@link RemoteFileInboundChannelAdapterSpec} for an {@link SftpInboundFileSynchronizingMessageSource}.
@@ -44,7 +45,7 @@ public class SftpInboundChannelAdapterSpec
SftpInboundFileSynchronizingMessageSource> {
protected SftpInboundChannelAdapterSpec(SessionFactory<SftpClient.DirEntry> sessionFactory,
Comparator<File> comparator) {
@Nullable Comparator<File> comparator) {
super(new SftpInboundFileSynchronizer(sessionFactory));
this.target = new SftpInboundFileSynchronizingMessageSource(this.synchronizer, comparator);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2022 the original author or authors.
* Copyright 2016-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@ import org.springframework.integration.sftp.filters.SftpPersistentAcceptOnceFile
import org.springframework.integration.sftp.filters.SftpRegexPatternFileListFilter;
import org.springframework.integration.sftp.filters.SftpSimplePatternFileListFilter;
import org.springframework.integration.sftp.inbound.SftpStreamingMessageSource;
import org.springframework.lang.Nullable;
/**
* @author Gary Russell
@@ -41,7 +42,7 @@ public class SftpStreamingInboundChannelAdapterSpec
SftpStreamingInboundChannelAdapterSpec, SftpStreamingMessageSource> {
protected SftpStreamingInboundChannelAdapterSpec(RemoteFileTemplate<SftpClient.DirEntry> remoteFileTemplate,
Comparator<SftpClient.DirEntry> comparator) {
@Nullable Comparator<SftpClient.DirEntry> comparator) {
this.target = new SftpStreamingMessageSource(remoteFileTemplate, comparator);
}

View File

@@ -1,4 +1,6 @@
/**
* Provides SFTP Components for the Java DSL.
*/
@org.springframework.lang.NonNullApi
@org.springframework.lang.NonNullFields
package org.springframework.integration.sftp.dsl;