All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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());
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy