+ @Gson.TypeAdapters
+ public static class Parameters {
+ @Getter
+ private String filter;
+ @Getter
+ private BufferTimeout bufferTimeout;
+
+ private int maxConcurrency;
+
+ public Parameters() {}
+
+ public Parameters(String filter, BufferTimeout bufferTimeout, int maxConcurrency) {
+ this.filter = filter;
+ this.bufferTimeout = bufferTimeout;
+ this.maxConcurrency = maxConcurrency;
+ }
+
+ public int getMaxConcurrency() {
+ return maxConcurrency == 0 ? 1 : maxConcurrency;
+ }
+ }
+
+ @Gson.TypeAdapters
+ public static class BufferTimeout {
+ public BufferTimeout(int maxSize, long maxTimeMiliseconds) {
+ this.maxSize = maxSize;
+ this.maxTimeMiliseconds = maxTimeMiliseconds;
+ }
+
+ public BufferTimeout() {}
+
+ @Getter
+ private int maxSize;
+
+ private long maxTimeMiliseconds;
+
+ public Duration getMaxTime() {
+ return Duration.ofMillis(maxTimeMiliseconds);
+ }
+ }
+