@@ -130,26 +130,26 @@ enum TrimOperator {
130130 }
131131
132132 @ NullMarked
133- class XTrimOptions {
133+ class TrimOptions {
134134
135135 private final TrimStrategy <?> trimStrategy ;
136136 private final TrimOperator trimOperator ;
137137 private final @ Nullable Long limit ;
138138 private final @ Nullable StreamDeletionPolicy deletionPolicy ;
139139
140- private XTrimOptions (TrimStrategy <?> trimStrategy , TrimOperator trimOperator , @ Nullable Long limit , @ Nullable StreamDeletionPolicy deletionPolicy ) {
140+ private TrimOptions (TrimStrategy <?> trimStrategy , TrimOperator trimOperator , @ Nullable Long limit , @ Nullable StreamDeletionPolicy deletionPolicy ) {
141141 this .trimStrategy = trimStrategy ;
142142 this .trimOperator = trimOperator ;
143143 this .limit = limit ;
144144 this .deletionPolicy = deletionPolicy ;
145145 }
146146
147- public static XTrimOptions maxLen (Long maxLen ) {
148- return new XTrimOptions (new MaxLenTrimStrategy (maxLen ), TrimOperator .EXACT , null , null );
147+ public static TrimOptions maxLen (Long maxLen ) {
148+ return new TrimOptions (new MaxLenTrimStrategy (maxLen ), TrimOperator .EXACT , null , null );
149149 }
150150
151- public static XTrimOptions minId (RecordId minId ) {
152- return new XTrimOptions (new MinIdTrimStrategy (minId ), TrimOperator .EXACT , null , null );
151+ public static TrimOptions minId (RecordId minId ) {
152+ return new TrimOptions (new MinIdTrimStrategy (minId ), TrimOperator .EXACT , null , null );
153153 }
154154
155155 /**
@@ -160,8 +160,8 @@ public static XTrimOptions minId(RecordId minId) {
160160 * @param trimOperator the operator to use when trimming
161161 * @return new instance of {@link XTrimOptions}.
162162 */
163- public XTrimOptions withTrimOperator (TrimOperator trimOperator ) {
164- return new XTrimOptions (trimStrategy , trimOperator , limit , deletionPolicy );
163+ public TrimOptions withTrimOperator (TrimOperator trimOperator ) {
164+ return new TrimOptions (trimStrategy , trimOperator , limit , deletionPolicy );
165165 }
166166
167167 /**
@@ -172,8 +172,8 @@ public XTrimOptions withTrimOperator(TrimOperator trimOperator) {
172172 * @param limit the maximum number of entries to examine for trimming.
173173 * @return new instance of {@link XTrimOptions}.
174174 */
175- public XTrimOptions withLimit (long limit ) {
176- return new XTrimOptions (trimStrategy , trimOperator , limit , deletionPolicy );
175+ public TrimOptions withLimit (long limit ) {
176+ return new TrimOptions (trimStrategy , trimOperator , limit , deletionPolicy );
177177 }
178178
179179 /**
@@ -184,8 +184,8 @@ public XTrimOptions withLimit(long limit) {
184184 * @param deletionPolicy the deletion policy to apply.
185185 * @return new instance of {@link XTrimOptions}.
186186 */
187- public XTrimOptions withDeletionPolicy (StreamDeletionPolicy deletionPolicy ) {
188- return new XTrimOptions (trimStrategy , trimOperator , limit , deletionPolicy );
187+ public TrimOptions withDeletionPolicy (StreamDeletionPolicy deletionPolicy ) {
188+ return new TrimOptions (trimStrategy , trimOperator , limit , deletionPolicy );
189189 }
190190
191191 public TrimStrategy <?> getTrimStrategy () {
@@ -236,7 +236,7 @@ public boolean equals(@Nullable Object o) {
236236 if (this == o ) {
237237 return true ;
238238 }
239- if (!(o instanceof XTrimOptions that )) {
239+ if (!(o instanceof TrimOptions that )) {
240240 return false ;
241241 }
242242 if (this .trimStrategy .equals (that .trimStrategy )) {
@@ -258,6 +258,14 @@ public int hashCode() {
258258 }
259259 }
260260
261+ @ NullMarked
262+ record XTrimOptions (TrimOptions trimOptions ) {
263+
264+ public static XTrimOptions of (TrimOptions trimOptions ) {
265+ return new XTrimOptions (trimOptions );
266+ }
267+ }
268+
261269 /**
262270 * Additional options applicable for {@literal XADD} command.
263271 *
@@ -270,9 +278,9 @@ public int hashCode() {
270278 class XAddOptions {
271279
272280 private final boolean nomkstream ;
273- private final @ Nullable XTrimOptions trimOptions ;
281+ private final @ Nullable TrimOptions trimOptions ;
274282
275- private XAddOptions (boolean nomkstream , @ Nullable XTrimOptions trimOptions ) {
283+ private XAddOptions (boolean nomkstream , @ Nullable TrimOptions trimOptions ) {
276284 this .nomkstream = nomkstream ;
277285 this .trimOptions = trimOptions ;
278286 }
@@ -291,7 +299,7 @@ public XAddOptions withNoMkStream(boolean nomkstream) {
291299 return new XAddOptions (nomkstream , trimOptions );
292300 }
293301
294- public XAddOptions withTrimOptions (@ Nullable XTrimOptions trimOptions ) {
302+ public XAddOptions withTrimOptions (@ Nullable TrimOptions trimOptions ) {
295303 return new XAddOptions (nomkstream , trimOptions );
296304 }
297305
@@ -307,7 +315,7 @@ public boolean hasTrimOptions() {
307315 return trimOptions != null ;
308316 }
309317
310- public @ Nullable XTrimOptions getTrimOptions () {
318+ public @ Nullable TrimOptions getTrimOptions () {
311319 return trimOptions ;
312320 }
313321
@@ -751,7 +759,7 @@ public int hashCode() {
751759 * are deleted concerning consumer groups.
752760 *
753761 * @param key the {@literal key} the stream is stored at.
754- * @param options the {@link XDelOptions} specifying deletion policy. Use {@link XDelOptions#defaultOptions ()} for default behavior.
762+ * @param options the {@link XDelOptions} specifying deletion policy. Use {@link XDelOptions#defaults()} ()} for default behavior.
755763 * @param recordIds the id's of the records to remove.
756764 * @return list of {@link StreamEntryDeletionResult} for each ID: {@link StreamEntryDeletionResult#NOT_FOUND} if no such ID exists,
757765 * {@link StreamEntryDeletionResult#DELETED} if the entry was deleted, {@link StreamEntryDeletionResult#NOT_DELETED_UNACKNOWLEDGED_OR_STILL_REFERENCED}
@@ -770,7 +778,7 @@ default List<StreamEntryDeletionResult> xDelEx(byte @NonNull [] key, XDelOptions
770778 * are deleted concerning consumer groups.
771779 *
772780 * @param key the {@literal key} the stream is stored at.
773- * @param options the {@link XDelOptions} specifying deletion policy. Use {@link XDelOptions#defaultOptions ()} for default behavior.
781+ * @param options the {@link XDelOptions} specifying deletion policy. Use {@link XDelOptions#defaults()} ()} for default behavior.
774782 * @param recordIds the id's of the records to remove.
775783 * @return list of {@link StreamEntryDeletionResult} for each ID: {@link StreamEntryDeletionResult#NOT_FOUND} if no such ID exists,
776784 * {@link StreamEntryDeletionResult#DELETED} if the entry was deleted, {@link StreamEntryDeletionResult#NOT_DELETED_UNACKNOWLEDGED_OR_STILL_REFERENCED}
@@ -788,7 +796,7 @@ default List<StreamEntryDeletionResult> xDelEx(byte @NonNull [] key, XDelOptions
788796 *
789797 * @param key the {@literal key} the stream is stored at.
790798 * @param group name of the consumer group.
791- * @param options the {@link XDelOptions} specifying deletion policy. Use {@link XDelOptions#defaultOptions ()} for default behavior.
799+ * @param options the {@link XDelOptions} specifying deletion policy. Use {@link XDelOptions#defaults()} ()} for default behavior.
792800 * @param recordIds the id's of the records to acknowledge and remove.
793801 * @return list of {@link StreamEntryDeletionResult} for each ID: {@link StreamEntryDeletionResult#DELETED} if the entry was acknowledged and deleted,
794802 * {@link StreamEntryDeletionResult#NOT_FOUND} if no such ID exists, {@link StreamEntryDeletionResult#NOT_DELETED_UNACKNOWLEDGED_OR_STILL_REFERENCED}
@@ -808,7 +816,7 @@ default List<StreamEntryDeletionResult> xAckDel(byte @NonNull [] key, @NonNull S
808816 *
809817 * @param key the {@literal key} the stream is stored at.
810818 * @param group name of the consumer group.
811- * @param options the {@link XDelOptions} specifying deletion policy. Use {@link XDelOptions#defaultOptions ()} for default behavior.
819+ * @param options the {@link XDelOptions} specifying deletion policy. Use {@link XDelOptions#defaults()} ()} for default behavior.
812820 * @param recordIds the id's of the records to acknowledge and remove.
813821 * @return list of {@link StreamEntryDeletionResult} for each ID: {@link StreamEntryDeletionResult#DELETED} if the entry was acknowledged and deleted,
814822 * {@link StreamEntryDeletionResult#NOT_FOUND} if no such ID exists, {@link StreamEntryDeletionResult#NOT_DELETED_UNACKNOWLEDGED_OR_STILL_REFERENCED}
0 commit comments