private <M extends BaseMessage> void consume(Consumer<M> consumer, M message,
String identifier) {
if (Objects.equals(message.getField(identifier), this.identifier.get())) {
- consumer.accept(message);
- notifySyncObject();
+ consumeAlways(consumer, message);
}
}
+ private <M extends BaseMessage> void consumeAlways(Consumer<M> consumer, M message) {
+ consumer.accept(message);
+ notifySyncObject();
+ }
+
private void consumeUnknown(FcpMessage fcpMessage) {
if (Objects.equals(fcpMessage.getField("Identifier"), identifier.get())) {
consumeUnknownMessage(fcpMessage);
@Override
public final void receivedCloseConnectionDuplicateClientName(FcpConnection fcpConnection,
CloseConnectionDuplicateClientName closeConnectionDuplicateClientName) {
- consume(this::consumeCloseConnectionDuplicateClientName, closeConnectionDuplicateClientName);
+ consumeAlways(this::consumeCloseConnectionDuplicateClientName, closeConnectionDuplicateClientName);
}
protected void consumeCloseConnectionDuplicateClientName(CloseConnectionDuplicateClientName closeConnectionDuplicateClientName) { }