Clover icon

sunshower-core

  1. Project Clover database Fri Apr 6 2018 03:27:42 UTC
  2. Package io.sunshower.service.hal.core

File Stylesheet.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart4.png
46% of files have more coverage

Code metrics

4
8
4
1
39
31
6
0.75
2
4
1.5

Classes

Class Line # Actions
Stylesheet 12 8 6
0.37537.5%
 

Contributing tests

This file is covered by 4 tests. .

Source view

1    package io.sunshower.service.hal.core;
2   
3    import io.sunshower.common.rs.MapAdapter;
4    import java.util.HashMap;
5    import java.util.Map;
6    import javax.xml.bind.annotation.XmlElement;
7    import javax.xml.bind.annotation.XmlRootElement;
8    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
9   
10    /** Created by haswell on 5/22/17. */
11    @XmlRootElement(name = "stylesheet")
 
12    public class Stylesheet {
13   
14    @XmlElement(name = "styles")
15    @XmlJavaTypeAdapter(MapAdapter.class)
16    private Map<String, String> styles;
17   
 
18  0 toggle public Map<String, String> getStyles() {
19  0 return styles;
20    }
21   
 
22  0 toggle public void setStyles(Map<String, String> styles) {
23  0 this.styles = styles;
24    }
25   
 
26  20 toggle public void set(String key, String value) {
27  20 if (styles == null) {
28  10 styles = new HashMap<>();
29    }
30  20 styles.put(key, value);
31    }
32   
 
33  0 toggle public String get(String key) {
34  0 if (styles == null) {
35  0 styles = new HashMap<>();
36    }
37  0 return styles.get(key);
38    }
39    }