Big code clean-up, added interfaces, and colored text

This commit is contained in:
2023-10-17 15:19:08 +03:00
parent 4ecd73d4ed
commit 79a11cf6cb
10 changed files with 135 additions and 88 deletions

View 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;
}
}

View 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"));
}
}

View 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;
}
}