Skip to content

Commit

Permalink
Add Nullability support into Java DSL
Browse files Browse the repository at this point in the history
  • Loading branch information
artembilan committed Apr 14, 2023
1 parent 053cc00 commit d5181bf
Show file tree
Hide file tree
Showing 105 changed files with 514 additions and 366 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2022 the original author or authors.
* Copyright 2017-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.
Expand Down Expand Up @@ -290,7 +290,7 @@ public S recoveryBackOff(BackOff recoveryBackOff) {

/**
* Set the {@link MessagePropertiesConverter} for this listener container.
* @param messagePropertiesConverter The properties converter.
* @param messagePropertiesConverter the converter for AMQP properties.
* @return the spec.
* @see AbstractMessageListenerContainer#setMessagePropertiesConverter(MessagePropertiesConverter)
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 the original author or authors.
* Copyright 2017-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.
Expand Down Expand Up @@ -36,7 +36,9 @@ protected AmqpInboundChannelAdapterDMLCSpec(DirectMessageListenerContainer liste
super(new DirectMessageListenerContainerSpec(listenerContainer));
}

public AmqpInboundChannelAdapterDMLCSpec configureContainer(Consumer<DirectMessageListenerContainerSpec> configurer) {
public AmqpInboundChannelAdapterDMLCSpec configureContainer(
Consumer<DirectMessageListenerContainerSpec> configurer) {

configurer.accept((DirectMessageListenerContainerSpec) this.listenerContainerSpec);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 the original author or authors.
* Copyright 2017-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.
Expand Down Expand Up @@ -37,7 +37,9 @@ protected AmqpInboundChannelAdapterSMLCSpec(SimpleMessageListenerContainer liste
super(new SimpleMessageListenerContainerSpec(listenerContainer));
}

public AmqpInboundChannelAdapterSMLCSpec configureContainer(Consumer<SimpleMessageListenerContainerSpec> configurer) {
public AmqpInboundChannelAdapterSMLCSpec configureContainer(
Consumer<SimpleMessageListenerContainerSpec> configurer) {

configurer.accept((SimpleMessageListenerContainerSpec) this.listenerContainerSpec);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* Provides AMQP Component support for the Java DSL.
*/
@org.springframework.lang.NonNullApi
package org.springframework.integration.amqp.dsl;
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
* Provides Apache Cassandra Components support for the Java DSL.
*/
@org.springframework.lang.NonNullApi
@org.springframework.lang.NonNullFields
package org.springframework.integration.cassandra.dsl;
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -50,6 +50,7 @@
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
import org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor;
import org.springframework.integration.handler.MessageProcessor;
import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;

Expand All @@ -75,6 +76,7 @@ public class CassandraMessageHandler extends AbstractReplyProducingMessageHandle
/**
* Prepared statement to use in association with high throughput ingestion.
*/
@Nullable
private String ingestQuery;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
/*
* Copyright 2022 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* Provides classes supporting Cassandra outbound endpoints.
*/
@org.springframework.lang.NonNullApi
package org.springframework.integration.cassandra.outbound;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-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.
Expand All @@ -25,6 +25,7 @@
import org.springframework.integration.aggregator.HeaderAttributeCorrelationStrategy;
import org.springframework.integration.aggregator.MethodInvokingCorrelationStrategy;
import org.springframework.integration.util.MessagingAnnotationUtils;
import org.springframework.lang.NonNull;
import org.springframework.util.StringUtils;

/**
Expand Down Expand Up @@ -75,6 +76,7 @@ public void afterPropertiesSet() {
}
}

@NonNull
@Override
public CorrelationStrategy getObject() {
return this.strategy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-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.
Expand Down Expand Up @@ -27,6 +27,7 @@
import org.springframework.integration.aggregator.ReleaseStrategy;
import org.springframework.integration.aggregator.SimpleSequenceSizeReleaseStrategy;
import org.springframework.integration.util.MessagingAnnotationUtils;
import org.springframework.lang.NonNull;
import org.springframework.util.StringUtils;

/**
Expand Down Expand Up @@ -87,6 +88,7 @@ public void afterPropertiesSet() {
}
}

@NonNull
@Override
public ReleaseStrategy getObject() {
return this.strategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo
private boolean initialized;

@Override
public final void setBeanName(String beanName) {
public final void setBeanName(@Nullable String beanName) {
this.beanName = beanName;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2021 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.
Expand Down Expand Up @@ -27,6 +27,7 @@
import org.springframework.integration.aggregator.MessageGroupProcessor;
import org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor;
import org.springframework.integration.store.MessageGroup;
import org.springframework.lang.Nullable;

/**
* A {@link CorrelationHandlerSpec} for an {@link AggregatingMessageHandler}.
Expand Down Expand Up @@ -65,7 +66,7 @@ public AggregatorSpec processor(Object target) {
* target object must have an {@link org.springframework.integration.annotation.Aggregator} annotation).
* @return the handler spec.
*/
public AggregatorSpec processor(Object target, String methodName) {
public AggregatorSpec processor(Object target, @Nullable String methodName) {
return super.processor(target)
.outputProcessor(methodName != null
? new MethodInvokingMessageGroupProcessor(target, methodName)
Expand Down
Loading

0 comments on commit d5181bf

Please sign in to comment.