Modernize code for diamond, isEmpty & pattern matching
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2022 the original author or authors.
|
||||
* Copyright 2015-2024 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.
|
||||
@@ -50,6 +50,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Eren Avsarogullari
|
||||
* @author Artem Bilan
|
||||
* @author Ngoc Nhan
|
||||
*
|
||||
* @since 6.0
|
||||
*/
|
||||
@@ -218,9 +219,9 @@ public abstract class AbstractHazelcastMessageProducer extends MessageProducerSu
|
||||
entryEvent.getValue(), entryEvent.getOldValue());
|
||||
return getMessageBuilderFactory().withPayload(messagePayload).copyHeaders(headers).build();
|
||||
}
|
||||
else if (event instanceof MapEvent) {
|
||||
else if (event instanceof MapEvent mapEvent) {
|
||||
return getMessageBuilderFactory()
|
||||
.withPayload(((MapEvent) event).getNumberOfEntriesAffected()).copyHeaders(headers).build();
|
||||
.withPayload(mapEvent.getNumberOfEntriesAffected()).copyHeaders(headers).build();
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException("Invalid event is received. Event : " + event);
|
||||
|
||||
Reference in New Issue
Block a user