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

alibaba / jetcache / #405

16 Apr 2024 05:58AM UTC coverage: 0.0% (-88.9%) from 88.866%
#405

push

areyouok
add encoding to fix coverage report

0 of 5353 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/jetcache-core/src/main/java/com/alicp/jetcache/RefreshPolicy.java
1
package com.alicp.jetcache;
2

3
import java.util.concurrent.TimeUnit;
4

5
/**
6
 * Created on 2017/5/25.
7
 *
8
 * @author huangli
9
 */
10
public class RefreshPolicy implements Cloneable {
11

12
    private long refreshMillis;
13
    private long stopRefreshAfterLastAccessMillis;
14
    private long refreshLockTimeoutMillis = 60 * 1000;
×
15

16
    public RefreshPolicy() {
×
17
    }
×
18

19
    public static RefreshPolicy newPolicy(long time, TimeUnit timeUnit) {
20
        RefreshPolicy p = new RefreshPolicy();
×
21
        p.refreshMillis = timeUnit.toMillis(time);
×
22
        return p;
×
23
    }
24

25
    public RefreshPolicy stopRefreshAfterLastAccess(long time, TimeUnit timeUnit) {
26
        this.stopRefreshAfterLastAccessMillis = timeUnit.toMillis(time);
×
27
        return this;
×
28
    }
29

30
    public RefreshPolicy refreshLockTimeout(long time, TimeUnit timeUnit) {
31
        this.refreshLockTimeoutMillis = timeUnit.toMillis(time);
×
32
        return this;
×
33
    }
34

35
    @Override
36
    public RefreshPolicy clone() {
37
        try {
38
            return (RefreshPolicy) super.clone();
×
39
        } catch (CloneNotSupportedException e) {
×
40
            throw new RuntimeException(e);
×
41
        }
42
    }
43

44
    public long getRefreshMillis() {
45
        return refreshMillis;
×
46
    }
47

48
    public void setRefreshMillis(long refreshMillis) {
49
        this.refreshMillis = refreshMillis;
×
50
    }
×
51

52
    public long getStopRefreshAfterLastAccessMillis() {
53
        return stopRefreshAfterLastAccessMillis;
×
54
    }
55

56
    public void setStopRefreshAfterLastAccessMillis(long stopRefreshAfterLastAccessMillis) {
57
        this.stopRefreshAfterLastAccessMillis = stopRefreshAfterLastAccessMillis;
×
58
    }
×
59

60
    public long getRefreshLockTimeoutMillis() {
61
        return refreshLockTimeoutMillis;
×
62
    }
63

64
    public void setRefreshLockTimeoutMillis(long refreshLockTimeoutMillis) {
65
        this.refreshLockTimeoutMillis = refreshLockTimeoutMillis;
×
66
    }
×
67
}
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

© 2025 Coveralls, Inc