Big code clean-up, added interfaces, and colored text
This commit is contained in:
15
Lab3/src/main/java/org/lumijiez/enums/DiffType.java
Normal file
15
Lab3/src/main/java/org/lumijiez/enums/DiffType.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package org.lumijiez.enums;
|
||||
|
||||
public enum DiffType {
|
||||
CREATE(StateType.NEW), DELETE(StateType.DELETED), MODIFY(StateType.MODIFIED), NONE(StateType.NONE);
|
||||
|
||||
private final StateType type;
|
||||
|
||||
DiffType(StateType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public StateType getState() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
16
Lab3/src/main/java/org/lumijiez/enums/FileType.java
Normal file
16
Lab3/src/main/java/org/lumijiez/enums/FileType.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package org.lumijiez.enums;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum FileType {
|
||||
IMAGE, PLAINTEXT, FILE, CODE;
|
||||
public List<String> typeExtensions;
|
||||
|
||||
static {
|
||||
IMAGE.typeExtensions = new ArrayList<>(List.of("jpg", "png"));
|
||||
PLAINTEXT.typeExtensions = new ArrayList<>(List.of("txt", "csv"));
|
||||
FILE.typeExtensions = new ArrayList<>(List.of("doc", "pdf", "zip"));
|
||||
CODE.typeExtensions = new ArrayList<>(List.of("java", "cpp", "py"));
|
||||
}
|
||||
}
|
||||
14
Lab3/src/main/java/org/lumijiez/enums/StateType.java
Normal file
14
Lab3/src/main/java/org/lumijiez/enums/StateType.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package org.lumijiez.enums;
|
||||
|
||||
public enum StateType {
|
||||
NEW("Created"), MODIFIED("Modified"), DELETED("Deleted"), NONE("Nothing");
|
||||
|
||||
private final String action;
|
||||
StateType(String name) {
|
||||
this.action = name;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return this.action;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user