laimis commented on code in PR #809: URL: https://github.com/apache/lucenenet/pull/809#discussion_r1161195044
########## src/Lucene.Net/Util/RollingBuffer.cs: ########## @@ -23,17 +22,32 @@ namespace Lucene.Net.Util */ /// <summary> - /// LUCENENET specific class to allow referencing static members of - /// <see cref="RollingBuffer{T}"/> without referencing its generic closing type. + /// Implement to reset an instance /// </summary> - public static class RollingBuffer + public interface IResettable { - /// <summary> - /// Implement to reset an instance - /// </summary> - public interface IResettable + void Reset(); + } + + /// <summary> + /// LUCENENET specific interface to allow overriding rolling buffer item creation + /// without having to call virtual methods from the constructor + /// </summary> + public interface IRollingBufferItemFactory<out T> + { + T Create(object rollingBuffer); + } + + /// <summary> + /// LUCENENET specific class that provides default implementation for + /// <see cref="IRollingBufferItemFactory{T}"/>. + /// </summary> + public class RollingBufferItemFactory<T> : IRollingBufferItemFactory<T> where T : new() + { + public static readonly RollingBufferItemFactory<T> Default = new RollingBufferItemFactory<T>(); Review Comment: Done! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org