1
2
3
4
5 package oshi.hardware;
6
7 import oshi.annotation.concurrent.Immutable;
8 import oshi.util.FormatUtil;
9
10
11
12
13
14
15 @Immutable
16 public class HWPartition {
17
18 private final String identification;
19 private final String name;
20 private final String type;
21 private final String uuid;
22 private final long size;
23 private final int major;
24 private final int minor;
25 private final String mountPoint;
26
27
28
29
30
31
32
33
34
35
36
37
38
39 public HWPartition(String identification, String name, String type, String uuid, long size, int major, int minor,
40 String mountPoint) {
41 this.identification = identification;
42 this.name = name;
43 this.type = type;
44 this.uuid = uuid;
45 this.size = size;
46 this.major = major;
47 this.minor = minor;
48 this.mountPoint = mountPoint;
49 }
50
51
52
53
54
55
56
57
58 public String getIdentification() {
59 return this.identification;
60 }
61
62
63
64
65
66
67
68
69 public String getName() {
70 return this.name;
71 }
72
73
74
75
76
77
78
79
80 public String getType() {
81 return this.type;
82 }
83
84
85
86
87
88
89
90
91 public String getUuid() {
92 return this.uuid;
93 }
94
95
96
97
98
99
100
101
102 public long getSize() {
103 return this.size;
104 }
105
106
107
108
109
110
111
112
113 public int getMajor() {
114 return this.major;
115 }
116
117
118
119
120
121
122
123
124 public int getMinor() {
125 return this.minor;
126 }
127
128
129
130
131
132
133
134
135 public String getMountPoint() {
136 return this.mountPoint;
137 }
138
139 @Override
140 public String toString() {
141 StringBuilder sb = new StringBuilder();
142 sb.append(getIdentification()).append(": ");
143 sb.append(getName()).append(" ");
144 sb.append("(").append(getType()).append(") ");
145 sb.append("Maj:Min=").append(getMajor()).append(":").append(getMinor()).append(", ");
146 sb.append("size: ").append(FormatUtil.formatBytesDecimal(getSize()));
147 sb.append(getMountPoint().isEmpty() ? "" : " @ " + getMountPoint());
148 return sb.toString();
149 }
150 }