forked from jeyben/fixedformat4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo.txt
143 lines (106 loc) · 3.22 KB
/
todo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
Bug
------------------------------------------
- ensure writing null values should not print null as string
- ensure that we can read a string that is to short for the offsets defined
Features
------------------------------------------
- Let the manager answer on format/parse errors.
- support round, ceil, floor etc. when handling decimal data.
- specific exception for errors that occurs because of wrong annotation usage
- Having Beloeb and OreBeloeb, KrBeloeb it would be nice to be able to represent the setters and getters as Beloeb and use a specific formatter for the two supclasses:
@Field(offset = 18, length = 5, align = Align.RIGHT, paddingChar = '0', formatter = OereBeloebFormatter.class)
public Beloeb getTimepris() {
return timepris;
}
public void setTimepris(OereBeloeb timepris) {
this.timepris = timepris;
}
@Field(offset = 38, length = 9, align = Align.RIGHT, paddingChar = '0', formatter = OereBeloebFormatter.class)
public Beloeb getTotalBeloeb() {
return totalBeloeb;
}
public void setTotalBeloeb(OereBeloeb totalBeloeb) { //<-- This should be a Bleob and not a specific OereBeloeb
this.totalBeloeb = totalBeloeb;
}
public abstract class Beloeb implements Serializable, Comparable<Beloeb> {
private Long oereBeloeb;
protected Beloeb() {
}
protected Long getOereBeloeb() {
return oereBeloeb;
}
protected void setOereBeloeb(Long oereBeloeb) {
this.oereBeloeb = oereBeloeb;
}
public double asKr() {
return oereBeloeb / 100.0;
}
public long asOere() {
return oereBeloeb;
}
public String formattedTwoDecimals() {
return NumberUtil.formatAsDecimal(asKr());
}
public int compareTo(Beloeb b) {
return oereBeloeb.compareTo(b.oereBeloeb);
}
public boolean lessThan(Beloeb beloeb) {
return compareTo(beloeb) < 0;
}
public boolean greaterThan(Beloeb beloeb) {
return compareTo(beloeb) > 0;
}
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Beloeb)) return false;
Beloeb beloeb = (Beloeb) o;
return compareTo(beloeb) == 0;
}
public int hashCode() {
return (oereBeloeb != null ? oereBeloeb.hashCode() : 0);
}
}
@Embeddable
public class OereBeloeb extends Beloeb {
protected OereBeloeb() {
}
public OereBeloeb(Integer oerebeloeb) {
setBeloeb((long) oerebeloeb);
}
public OereBeloeb(Long oerebeloeb) {
setBeloeb(oerebeloeb);
}
protected Long getBeloeb() {
return super.getOereBeloeb();
}
protected void setBeloeb(Long beloeb) {
super.setOereBeloeb(beloeb);
}
@Override
public String toString() {
return String.format("OereBeloeb [ore = %d]", getOereBeloeb());
}
}
@Embeddable
public class KrBeloeb extends Beloeb {
protected KrBeloeb() {
}
public KrBeloeb(Integer beloeb) {
setBeloeb(beloeb.longValue());
}
protected Long getBeloeb() {
return super.getOereBeloeb() / 100;
}
protected void setBeloeb(Long beloeb) {
super.setOereBeloeb(beloeb * 100);
}
@Override
public String toString() {
return String.format("KrBeloeb [ore = %d]", getOereBeloeb());
}
}
Site
------------------------------------------
- Include reports
- Include http://cobertura.sourceforge.net/
- document