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 2022 the original author or authors.
* Copyright 2022-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,11 +28,13 @@ import org.springframework.integration.file.remote.session.SessionFactory;
import org.springframework.integration.file.support.FileExistsMode;
import org.springframework.integration.smb.outbound.SmbOutboundGateway;
import org.springframework.integration.smb.session.SmbRemoteFileTemplate;
import org.springframework.lang.Nullable;
/**
* The factory for SMB components.
*
* @author Gregory Bragg
* @author Artem Bilan
*
* @since 6.0
*/
@@ -54,7 +56,7 @@ public final class Smb {
* @return the spec.
*/
public static SmbInboundChannelAdapterSpec inboundAdapter(SessionFactory<SmbFile> sessionFactory,
Comparator<File> receptionOrderComparator) {
@Nullable Comparator<File> receptionOrderComparator) {
return new SmbInboundChannelAdapterSpec(sessionFactory, receptionOrderComparator);
}
@@ -80,7 +82,7 @@ public final class Smb {
*/
public static SmbStreamingInboundChannelAdapterSpec inboundStreamingAdapter(
RemoteFileTemplate<SmbFile> remoteFileTemplate,
Comparator<SmbFile> receptionOrderComparator) {
@Nullable Comparator<SmbFile> receptionOrderComparator) {
return new SmbStreamingInboundChannelAdapterSpec(remoteFileTemplate, receptionOrderComparator);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2022 the original author or authors.
* Copyright 2022-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,11 +31,13 @@ import org.springframework.integration.smb.filters.SmbRegexPatternFileListFilter
import org.springframework.integration.smb.filters.SmbSimplePatternFileListFilter;
import org.springframework.integration.smb.inbound.SmbInboundFileSynchronizer;
import org.springframework.integration.smb.inbound.SmbInboundFileSynchronizingMessageSource;
import org.springframework.lang.Nullable;
/**
* A {@link RemoteFileInboundChannelAdapterSpec} for an {@link SmbInboundFileSynchronizingMessageSource}.
*
* @author Gregory Bragg
* @author Artem Bilan
*
* @since 6.0
*/
@@ -43,7 +45,9 @@ public class SmbInboundChannelAdapterSpec
extends RemoteFileInboundChannelAdapterSpec<SmbFile, SmbInboundChannelAdapterSpec,
SmbInboundFileSynchronizingMessageSource> {
protected SmbInboundChannelAdapterSpec(SessionFactory<SmbFile> sessionFactory, Comparator<File> comparator) {
protected SmbInboundChannelAdapterSpec(SessionFactory<SmbFile> sessionFactory,
@Nullable Comparator<File> comparator) {
super(new SmbInboundFileSynchronizer(sessionFactory));
this.target = new SmbInboundFileSynchronizingMessageSource(this.synchronizer, comparator);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2022 the original author or authors.
* Copyright 2022-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,11 +29,13 @@ import org.springframework.integration.smb.filters.SmbPersistentAcceptOnceFileLi
import org.springframework.integration.smb.filters.SmbRegexPatternFileListFilter;
import org.springframework.integration.smb.filters.SmbSimplePatternFileListFilter;
import org.springframework.integration.smb.inbound.SmbStreamingMessageSource;
import org.springframework.lang.Nullable;
/**
* A {@link RemoteFileStreamingInboundChannelAdapterSpec} for a {@link SmbStreamingMessageSource}.
*
* @author Gregory Bragg
* @author Artem Bilan
*
* @since 6.0
*/
@@ -42,7 +44,7 @@ public class SmbStreamingInboundChannelAdapterSpec
SmbStreamingMessageSource> {
protected SmbStreamingInboundChannelAdapterSpec(RemoteFileTemplate<SmbFile> remoteFileTemplate,
Comparator<SmbFile> comparator) {
@Nullable Comparator<SmbFile> comparator) {
this.target = new SmbStreamingMessageSource(remoteFileTemplate, comparator);
}

View File

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