Clover icon

sunshower-core

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

File Version.java

 

Coverage histogram

../../../../img/srcFileCovDistChart7.png
24% of files have more coverage

Code metrics

4
15
12
1
82
63
14
0.93
1.25
12
1.17

Classes

Class Line # Actions
Version 10 15 14
0.645161364.5%
 

Contributing tests

This file is covered by 1 test. .

Source view

1    package io.sunshower.model.core;
2   
3    import io.sunshower.common.Identifier;
4    import io.sunshower.persistence.core.DistributableEntity;
5    import javax.persistence.*;
6   
7    @Entity
8    @IdClass(Identifier.class)
9    @Table(name = "VERSION", schema = Schemata.SUNSHOWER)
 
10    public class Version {
11   
12    @Id private byte[] id;
13   
14    @Basic
15    @Column(name = "major")
16    private Integer major;
17   
18    @Basic
19    @Column(name = "minor")
20    private Integer minor;
21   
22    @Basic
23    @Column(name = "minor_minor")
24    private Integer minorMinor;
25   
26    @Basic
27    @Column(name = "extension")
28    private String extension;
29   
 
30  1 toggle public Version() {
31  1 setId(DistributableEntity.sequence.next());
32    }
33   
 
34  1 toggle public Identifier getId() {
35  1 if (id != null) {
36  1 return Identifier.valueOf(id);
37    }
38  0 return null;
39    }
40   
 
41  1 toggle public void setId(Identifier id) {
42  1 if (id != null) {
43  1 this.id = id.value();
44    }
45    }
46   
 
47  0 toggle public Integer getMajor() {
48  0 return major;
49    }
50   
 
51  1 toggle public void setMajor(Integer major) {
52  1 this.major = major;
53    }
54   
 
55  0 toggle public Integer getMinor() {
56  0 return minor;
57    }
58   
 
59  1 toggle public void setMinor(Integer minor) {
60  1 this.minor = minor;
61    }
62   
 
63  0 toggle public Integer getMinorMinor() {
64  0 return minorMinor;
65    }
66   
 
67  1 toggle public void setMinorMinor(Integer minorMinor) {
68  1 this.minorMinor = minorMinor;
69    }
70   
 
71  0 toggle public String getExtension() {
72  0 return extension;
73    }
74   
 
75  1 toggle public void setExtension(String extension) {
76  1 this.extension = extension;
77    }
78   
 
79  1 toggle public String toString() {
80  1 return String.format("%d.%d.%d-%s", major, minor, minorMinor, extension);
81    }
82    }