session-android/src/org/thoughtcrime/securesms/jobmanager/CompositeScheduler.java

23 lines
537 B
Java
Raw Normal View History

2019-03-28 15:56:35 +00:00
package org.thoughtcrime.securesms.jobmanager;
import android.support.annotation.NonNull;
import java.util.Arrays;
import java.util.List;
class CompositeScheduler implements Scheduler {
private final List<Scheduler> schedulers;
CompositeScheduler(@NonNull Scheduler... schedulers) {
this.schedulers = Arrays.asList(schedulers);
}
@Override
public void schedule(long delay, @NonNull List<Constraint> constraints) {
for (Scheduler scheduler : schedulers) {
scheduler.schedule(delay, constraints);
}
}
}