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

stasha / flex / 16

27 Apr 2025 11:53PM UTC coverage: 74.123% (+17.2%) from 56.927%
16

push

circleci

stasha
Re-factored project and directory name and added ordinals and plurals for 56 of countries

164 of 247 branches covered (66.4%)

Branch coverage included in aggregate %.

260 of 286 new or added lines in 10 files covered. (90.91%)

3 existing lines in 2 files now uncovered.

343 of 437 relevant lines covered (78.49%)

0.78 hits per line

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

84.38
/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 FlexStoreImpl<>();
1✔
15
    private FlexStringTemplateParser parser = new FlexStringTemplateParser();
1✔
16

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

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

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

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

48
    @Override
49
    public String getString(String key) {
50
        return super.get(key);
×
51
    }
52

53
    @Override
54
    public <T> T getObject(String key) {
55
        return (T) this.objectStore.get(key);
1✔
56
    }
57

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