Coverage Summary for Class: PunishmentParameters (co.rsk.scoring)
Class |
Class, %
|
Method, %
|
Line, %
|
PunishmentParameters |
0%
(0/1)
|
0%
(0/4)
|
0%
(0/8)
|
1 package co.rsk.scoring;
2
3 /**
4 * PunishmentParameters has the punishment parameters
5 * (initial duration, incremental percentage, maximum duration)
6 * <p>
7 * Created by ajlopez on 12/07/2017.
8 */
9 public class PunishmentParameters {
10 private final long duration;
11 private final int incrementRate;
12 private final long maximumDuration;
13
14 public PunishmentParameters(long duration, int incrementRate, long maximumDuration) {
15 this.duration = duration;
16 this.incrementRate = incrementRate;
17 this.maximumDuration = maximumDuration;
18 }
19
20 /**
21 * Returns the initial punishment duration
22 *
23 * @return duration in milliseconds
24 */
25 public long getDuration() { return this.duration; }
26
27 /**
28 * Returns the incremental percentage
29 *
30 * @return the percentage of increment to be applied to each new punishment
31 */
32 public int getIncrementRate() { return this.incrementRate; }
33
34 /**
35 * Returns the maximum duration to be applied
36 *
37 * @return the maximum duration in milliseconds
38 * (0 = no maximum)
39 */
40 public long getMaximumDuration() { return this.maximumDuration; }
41 }