• 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/external/ExternalCacheBuilder.java
1
package com.alicp.jetcache.external;
2

3
import com.alicp.jetcache.AbstractCacheBuilder;
4
import com.alicp.jetcache.CacheManager;
5
import com.alicp.jetcache.support.BroadcastManager;
6

7
import java.util.function.Function;
8
import java.util.function.Supplier;
9

10
/**
11
 * Created on 16/9/9.
12
 *
13
 * @author huangli
14
 */
15
public abstract class ExternalCacheBuilder<T extends ExternalCacheBuilder<T>> extends AbstractCacheBuilder<T> {
×
16

17
    @Override
18
    public ExternalCacheConfig getConfig() {
19
        if (config == null) {
×
20
            config = new ExternalCacheConfig();
×
21
        }
22
        return (ExternalCacheConfig) config;
×
23
    }
24

25
    public boolean supportBroadcast() {
26
        return false;
×
27
    }
28

29
    public BroadcastManager createBroadcastManager(CacheManager cacheManager) {
30
        return null;
×
31
    }
32

33
    public T broadcastChannel(String broadcastChannel) {
34
        getConfig().setBroadcastChannel(broadcastChannel);
×
35
        return self();
×
36
    }
37

38
    public void setBroadcastChannel(String broadcastChannel) {
39
        getConfig().setBroadcastChannel(broadcastChannel);
×
40
    }
×
41

42
    public T keyPrefix(String keyPrefix) {
43
        getConfig().setKeyPrefixSupplier(() -> keyPrefix);
×
44
        return self();
×
45
    }
46

47
    public T keyPrefixSupplier(Supplier<String> keyPrefixSupplier) {
48
        getConfig().setKeyPrefixSupplier(keyPrefixSupplier);
×
49
        return self();
×
50
    }
51

52
    public T valueEncoder(Function<Object, byte[]> valueEncoder){
53
        getConfig().setValueEncoder(valueEncoder);
×
54
        return self();
×
55
    }
56

57
    public T valueDecoder(Function<byte[], Object> valueDecoder){
58
        getConfig().setValueDecoder(valueDecoder);
×
59
        return self();
×
60
    }
61

62
    public void setKeyPrefix(String keyPrefix){
63
        if (keyPrefix != null) {
×
64
            getConfig().setKeyPrefixSupplier(() -> keyPrefix);
×
65
        } else {
66
            getConfig().setKeyPrefixSupplier(null);
×
67
        }
68
    }
×
69

70
    public void setKeyPrefixSupplier(Supplier<String> keyPrefixSupplier){
71
        getConfig().setKeyPrefixSupplier(keyPrefixSupplier);
×
72
    }
×
73

74
    public void setValueEncoder(Function<Object, byte[]> valueEncoder){
75
        getConfig().setValueEncoder(valueEncoder);
×
76
    }
×
77

78
    public void setValueDecoder(Function<byte[], Object> valueDecoder){
79
        getConfig().setValueDecoder(valueDecoder);
×
80
    }
×
81
}
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