This commit is contained in:
parent
c49fc00d0e
commit
baf625f959
4 changed files with 7 additions and 16 deletions
|
|
@ -30,8 +30,7 @@ public class MoneyMarketSecurityService extends QueueConsumer implements Initial
|
|||
public void afterPropertiesSet() {
|
||||
callback(MoneyMarketSecurityNewRequest.class)
|
||||
.setConsumer(this::newMoneyMarket)
|
||||
.setDestination(Consts.DESTINATION_MONEY_MARKET_SECURITY_NEW, callbacks::put)
|
||||
.build();
|
||||
.forDestination(Consts.DESTINATION_MONEY_MARKET_SECURITY_NEW, callbacks::put);
|
||||
init();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ package ru.spcex.clearing.platform.messaging.logic.functional;
|
|||
import java.util.function.Consumer;
|
||||
|
||||
public interface BuilderConsumerStep<T1> {
|
||||
BuilderDestinationStep<T1> setConsumer(Consumer<T1> consumer);
|
||||
BuilderDestinationStep setConsumer(Consumer<T1> consumer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@ package ru.spcex.clearing.platform.messaging.logic.functional;
|
|||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
public interface BuilderDestinationStep<T1> {
|
||||
Builder<T1> setDestination(String destination, BiConsumer<String, ConsumerSpecificClass<?>> mappingFun);
|
||||
public interface BuilderDestinationStep {
|
||||
void forDestination(String destination, BiConsumer<String, ConsumerSpecificClass<?>> mappingFun);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package ru.spcex.clearing.platform.messaging.logic.functional;
|
|||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class ConsumerSpecificClass<T> implements BuilderConsumerStep<T>, BuilderDestinationStep<T>, Builder<T> {
|
||||
public class ConsumerSpecificClass<T> implements BuilderConsumerStep<T>, BuilderDestinationStep {
|
||||
private Class<T> clazz;
|
||||
private java.util.function.Consumer<T> consumer;
|
||||
|
||||
|
|
@ -11,9 +11,8 @@ public class ConsumerSpecificClass<T> implements BuilderConsumerStep<T>, Builder
|
|||
this.clazz = clazz;
|
||||
}
|
||||
|
||||
public Builder<T> setDestination(String destination, BiConsumer<String, ConsumerSpecificClass<?>> fun) {
|
||||
public void forDestination(String destination, BiConsumer<String, ConsumerSpecificClass<?>> fun) {
|
||||
fun.accept(destination, this);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void accept(T obj) {
|
||||
|
|
@ -33,15 +32,8 @@ public class ConsumerSpecificClass<T> implements BuilderConsumerStep<T>, Builder
|
|||
}
|
||||
|
||||
@Override
|
||||
public BuilderDestinationStep<T> setConsumer(Consumer<T> consumer) {
|
||||
public BuilderDestinationStep setConsumer(Consumer<T> consumer) {
|
||||
this.consumer = consumer;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumerSpecificClass<T> build() {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue