org.bardframework.commons.sms.SmsSenderRanked Maven / Gradle / Ivy
package org.bardframework.commons.sms;
import java.io.IOException;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Stack;
public class SmsSenderRanked implements SmsSender {
private final List senders;
public SmsSenderRanked(List senders) {
this.senders = senders;
}
public List getSenders() {
return senders;
}
@Override
public boolean send(Map args) throws IOException {
Stack sendersStack = new Stack<>();
this.senders.stream().sorted(this.comparator()).forEach(sendersStack::add);
return sendersStack.pop().send(args);
}
protected Comparator comparator() {
return (o1, o2) -> 0;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy