com.aventstack.extentreports.observable.ObservableList Maven / Gradle / Ivy
package com.aventstack.extentreports.observable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.aventstack.extentreports.model.BaseEntity;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.subjects.PublishSubject;
import lombok.Getter;
@Getter
public class ObservableList {
private final List list = Collections.synchronizedList(new ArrayList<>());
private final PublishSubject observable = PublishSubject.create();
public void subscribe(Observer observer) {
observable.subscribe(observer);
}
public void add(T value) {
list.add(value);
observable.onNext(value);
}
public void remove(T value) {
}
public Observable getObservable() {
return observable;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy