summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java b/src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java
new file mode 100644
index 0000000..4180a19
--- /dev/null
+++ b/src/main/java/com/keuin/kbackupfabric/metadata/MetadataHolder.java
@@ -0,0 +1,22 @@
+package com.keuin.kbackupfabric.metadata;
+
+/**
+ * In the first startup after restoring from a previous backup, the metadata is stored in this class.
+ * The setMetadata can only be called when startup
+ */
+public class MetadataHolder {
+ private static BackupMetadata metadata = null;
+
+ public static BackupMetadata getMetadata() {
+ return metadata;
+ }
+
+ public static void setMetadata(BackupMetadata metadata) {
+ if (MetadataHolder.metadata == null)
+ MetadataHolder.metadata = metadata;
+ }
+
+ public static boolean hasMetadata() {
+ return MetadataHolder.metadata != null;
+ }
+}