Skip to content

Commit 0991984

Browse files
committed
name into enum
1 parent 7da59c6 commit 0991984

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

src/main/java/DiscUtils/Fat/FatFileSystem.java

+1-11
Original file line numberDiff line numberDiff line change
@@ -321,17 +321,7 @@ public void setFileSystemType(String value) {
321321
* Gets the friendly name for the file system, including FAT variant.
322322
*/
323323
public String getFriendlyName() {
324-
switch (getFatVariant()) {
325-
case Fat12:
326-
return "Microsoft FAT12";
327-
case Fat16:
328-
return "Microsoft FAT16";
329-
case Fat32:
330-
return "Microsoft FAT32";
331-
default:
332-
return "Unknown FAT";
333-
334-
}
324+
return _fatVariant.getFriendlyName();
335325
}
336326

337327
/**

src/main/java/DiscUtils/Fat/FatType.java

+11-5
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,34 @@ public enum FatType {
3232
/**
3333
* Represents no known FAT type.
3434
*/
35-
None(0),
35+
None(0, "Unknown FAT"),
3636
/**
3737
* Represents a 12-bit FAT.
3838
*/
39-
Fat12(12),
39+
Fat12(12, "Microsoft FAT12"),
4040
/**
4141
* Represents a 16-bit FAT.
4242
*/
43-
Fat16(16),
43+
Fat16(16, "Microsoft FAT16"),
4444
/**
4545
* Represents a 32-bit FAT.
4646
*/
47-
Fat32(32);
47+
Fat32(32, "Microsoft FAT32");
4848

4949
private int value;
50+
private String friendlyName;
5051

5152
public int getValue() {
5253
return value;
5354
}
5455

55-
private FatType(int value) {
56+
public String getFriendlyName() {
57+
return friendlyName;
58+
}
59+
60+
private FatType(int value, String friendlyName) {
5661
this.value = value;
62+
this.friendlyName = friendlyName;
5763
}
5864

5965
public static FatType valueOf(int value) {

0 commit comments

Comments
 (0)