1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.jute.base;
17
18 public enum Size {
19
20 BYTE(1, "b", "bytes/s"),
21 KB(1024, "k", "KB/s"),
22 MB(1024 * KB.getValue(), "m", "MB/s"),
23 GB(1024 * MB.getValue(), "g", "GB/s"),
24 TB(1024 * GB.getValue(), "t", "TB/s"),
25 PB(1024 * TB.getValue(), "p", "PB/s"),
26 EB(1024 * PB.getValue(), "e", "EB/s");
27
28 private long value;
29 private String sizeLabel;
30 private String rateLabel;
31
32 private Size(long value, String sizeLabel, String rateLabel) {
33 this.value = value;
34 this.sizeLabel = sizeLabel;
35 this.rateLabel = rateLabel;
36 }
37
38 public long getValue() {
39 return value;
40 }
41
42 public String getSizeLabel() {
43 return sizeLabel;
44 }
45
46 public String getRateLabel() {
47 return rateLabel;
48 }
49
50 }