summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/data/PendingOperation.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-04-24 13:10:00 +0800
committerkeuin <[email protected]>2020-04-24 13:10:00 +0800
commit59674ed29c6b2c7e8ac98fc4f0f4fd4fd6d437c9 (patch)
tree47730fe93306b41b68f29b86ef5d0860c0d53d42 /src/main/java/com/keuin/kbackupfabric/data/PendingOperation.java
parent5749fc65909f0ee934d0410406265387157575a1 (diff)
Implemented uniformed console output (log4j) in PrintUtil.
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/data/PendingOperation.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/data/PendingOperation.java41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/data/PendingOperation.java b/src/main/java/com/keuin/kbackupfabric/data/PendingOperation.java
deleted file mode 100644
index 8f7490c..0000000
--- a/src/main/java/com/keuin/kbackupfabric/data/PendingOperation.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.keuin.kbackupfabric.data;
-
-public class PendingOperation {
- private final PendingOperationType operationType;
- private final String backupName;
-
- public PendingOperation(PendingOperationType operationType, String backupName) {
- this.operationType = operationType;
- this.backupName = backupName;
- }
-
- public static PendingOperation deleteOperation(String backupName) {
- return new PendingOperation(PendingOperationType.DELETE, backupName);
- }
-
- public static PendingOperation restoreOperation(String backupName) {
- return new PendingOperation(PendingOperationType.RESTORE_TO, backupName);
- }
-
- public boolean isDelete() {
- return operationType == PendingOperationType.DELETE;
- }
-
- public boolean isRestore() {
- return operationType == PendingOperationType.RESTORE_TO;
- }
-
- public String getBackupName() {
- return backupName;
- }
-
- @Override
- public String toString() {
- String op = "operation";
- if (isDelete())
- op = "deletion";
- if (isRestore())
- op = "restoration";
- return String.format("%s on backup %s", op, getBackupName());
- }
-}