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

stasha / flex / 17

29 Apr 2025 11:38PM UTC coverage: 67.722% (-6.4%) from 74.123%
17

push

circleci

stasha
Added bunch of changes and various experiments

206 of 343 branches covered (60.06%)

Branch coverage included in aggregate %.

143 of 219 new or added lines in 12 files covered. (65.3%)

4 existing lines in 2 files now uncovered.

436 of 605 relevant lines covered (72.07%)

0.72 hits per line

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

80.56
/src/main/java/com/stasha/info/flex/store/FlexStringStoreImpl.java
1
package com.stasha.info.flex.store;
2

3
import com.stasha.info.flex.parsers.FlexParsedTemplate;
4
import com.stasha.info.flex.parsers.FlexStringTemplateParser;
5
import java.util.ArrayList;
6

7
/**
8
 * Store for storing string key/value pairs.
9
 *
10
 * @author stasha
11
 */
12
public class FlexStringStoreImpl extends FlexStoreImpl<String> implements FlexStringStore {
1✔
13

14
    private FlexStore<String, Object> objectStore = new FlexObjectStore<>();
1✔
15
    private FlexStore<String, Object> cacheStore = new FlexCacheStore<>();
1✔
16
    private FlexStringTemplateParser parser = new FlexStringTemplateParser();
1✔
17

18
    @Override
19
    public void put(String key, String value) {
20
        if (key != null && key.endsWith("]")) {
1!
21
            String option = key.substring(0, key.lastIndexOf("["));
1✔
22
            String optionValue = key.substring(key.lastIndexOf("[") + 1, key.lastIndexOf("]"));
1✔
23
            String optionKey = new StringBuilder(option).append("$options").toString();
1✔
24
            ArrayList<String> options = (ArrayList<String>) getObjectStore().get(optionKey);
1✔
25
            if (options == null) {
1✔
26
                options = new ArrayList<>();
1✔
27
            }
28

29
            options.add(optionValue);
1✔
30
            getObjectStore().put(optionKey, options);
1✔
31
        }
32
        if (value != null && value.endsWith("]")) {
1!
33
            FlexParsedTemplate template = parser.parse(value);
1✔
34
            getObjectStore().put(key, template);
1✔
35
        }
36
        super.put(key, value);
1✔
37
    }
1✔
38

39
    @Override
40
    public <T> void setObjectStore(FlexStore<String, T> objectStore) {
41
        this.objectStore = (FlexStore<String, Object>) objectStore;
×
42
    }
×
43

44
    @Override
45
    public <T> FlexStore<String, T> getObjectStore() {
46
        return (FlexStore<String, T>) this.objectStore;
1✔
47
    }
48

49
    @Override
50
    public <T> FlexStore<String, T> getCacheStore() {
51
        return (FlexStore<String, T>) cacheStore;
1✔
52
    }
53

54
    public <T> void setCacheStore(FlexStore<String, T> cacheStore) {
NEW
55
        this.cacheStore = (FlexStore<String, Object>) cacheStore;
×
NEW
56
    }
×
57

58
    @Override
59
    public String getString(String key) {
60
        return super.get(key);
×
61
    }
62

63
    @Override
64
    public <T> T getObject(String key) {
65
        return (T) this.objectStore.get(key);
1✔
66
    }
67

68
}
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