com.github.grzesiek_galezowski.test_environment.buffer.ReceivedObjectBuffer Maven / Gradle / Ivy
package com.github.grzesiek_galezowski.test_environment.buffer;
import com.github.grzesiek_galezowski.test_environment.buffer.implementation.BufferItemNotificationSubscribers;
import com.github.grzesiek_galezowski.test_environment.buffer.implementation.DefaultReceivedObjectBuffer;
import com.github.grzesiek_galezowski.test_environment.buffer.implementation.SynchronizedReceivedObjectBuffer;
import com.github.grzesiek_galezowski.test_environment.buffer.interfaces.*;
/**
* Created by grzes on 09.07.2017.
*/
public interface ReceivedObjectBuffer {
static Buffer observedBy(
BufferObserver observer) {
return new SynchronizedReceivedObjectBuffer<>(
new DefaultReceivedObjectBuffer<>(
observer,
new BufferItemNotificationSubscribers<>(observer)),
observer);
}
static Buffer createDefault() {
return observedBy(BufferObservers.none());
}
}