• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

leonchen83 / redis-replicator / #2567

11 Oct 2025 04:55AM UTC coverage: 72.231% (+0.03%) from 72.206%
#2567

push

chenby
redis-8.2

7244 of 10029 relevant lines covered (72.23%)

0.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.67
/src/main/java/com/moilioncircle/redis/replicator/cmd/impl/XTrimCommand.java
1
/*
2
 * Copyright 2016-2018 Leon Chen
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.moilioncircle.redis.replicator.cmd.impl;
18

19
import com.moilioncircle.redis.replicator.cmd.CommandSpec;
20

21
/**
22
 * @author Leon Chen
23
 * @since 2.6.0
24
 */
25
@CommandSpec(command = "XTRIM")
26
public class XTrimCommand extends GenericKeyCommand {
27

28
    private static final long serialVersionUID = 1L;
29

30
    private MaxLen maxLen;
31
    private MinId minId;
32
    private Limit limit;
33
    private DeletionPolicy policy;
34

35
    public XTrimCommand() {
×
36
    }
×
37
    
38
    /**
39
     * @param key key
40
     * @param maxLen maxLen
41
     * @deprecated by {@link #XTrimCommand(byte[], MaxLen, MinId, Limit, DeletionPolicy)}
42
     */
43
    @Deprecated
44
    public XTrimCommand(byte[] key, MaxLen maxLen) {
45
        this(key, maxLen, null, null);
×
46
    }
×
47
    
48
    /**
49
     * @since 3.5.2
50
     * @param key key
51
     * @param maxLen maxLen
52
     * @param minId minId
53
     * @param limit limit
54
     * @deprecated by {@link #XTrimCommand(byte[], MaxLen, MinId, Limit, DeletionPolicy)}
55
     */
56
    @Deprecated
57
    public XTrimCommand(byte[] key, MaxLen maxLen, MinId minId, Limit limit) {
58
        this(key, maxLen, minId, limit, null);
×
59
    }
×
60
    
61
    /**
62
     * @since 3.10.0
63
     * @param key key
64
     * @param maxLen maxLen
65
     * @param minId minId
66
     * @param limit limit
67
     * @param policy deletion policy
68
     */
69
    public XTrimCommand(byte[] key, MaxLen maxLen, MinId minId, Limit limit, DeletionPolicy policy) {
70
        super(key);
1✔
71
        this.maxLen = maxLen;
1✔
72
        this.minId = minId;
1✔
73
        this.limit = limit;
1✔
74
        this.policy = policy;
1✔
75
    }
1✔
76
    
77
    /**
78
     * @return policy
79
     * @since 3.10.0
80
     */
81
    public DeletionPolicy getPolicy() {
82
        return policy;
1✔
83
    }
84
    
85
    /**
86
     * @param policy
87
     * @since 3.10.0
88
     */
89
    public void setPolicy(DeletionPolicy policy) {
90
        this.policy = policy;
×
91
    }
×
92
    
93
    public MaxLen getMaxLen() {
94
        return maxLen;
1✔
95
    }
96

97
    public void setMaxLen(MaxLen maxLen) {
98
        this.maxLen = maxLen;
×
99
    }
×
100
    
101
    /**
102
     * @return min id
103
     * @since 3.5.2
104
     */
105
    public MinId getMinId() {
106
        return minId;
1✔
107
    }
108
    
109
    /**
110
     * @param minId minId
111
     * @since 3.5.2
112
     */
113
    public void setMinId(MinId minId) {
114
        this.minId = minId;
×
115
    }
×
116
    
117
    /**
118
     * @return limit
119
     * @since 3.5.2
120
     */
121
    public Limit getLimit() {
122
        return limit;
1✔
123
    }
124
    
125
    /**
126
     * @param limit limit
127
     * @since 3.5.2
128
     */
129
    public void setLimit(Limit limit) {
130
        this.limit = limit;
×
131
    }
×
132
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc