yangys
2024-05-07 ec2552d891e163bd9054e0554188afc575bcdb70
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.qianwen.core.redis.cache;
 
import java.time.Duration;
import org.springframework.lang.Nullable;
 
public class CacheKey {
    private final String key;
    @Nullable
    private Duration expire;
 
    public String toString() {
        return "CacheKey(key=" + getKey() + ", expire=" + getExpire() + ")";
    }
 
    public CacheKey(final String key, @Nullable final Duration expire) {
        this.key = key;
        this.expire = expire;
    }
 
    public String getKey() {
        return this.key;
    }
 
    @Nullable
    public Duration getExpire() {
        return this.expire;
    }
 
    public CacheKey(String key) {
        this.key = key;
    }
}