Skip to content

Commit

Permalink
Add event interface
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldieeins committed Dec 22, 2024
1 parent f2f13ae commit 3340f7c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
32 changes: 2 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.zyneonstudios.nexus</groupId>
<artifactId>base-utilities</artifactId>
<version>2024.9.3</version>
<version>2024.12.1</version>

<properties>
<maven.compiler.source>21</maven.compiler.source>
Expand All @@ -27,40 +27,12 @@
<version>1.27.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.46.1.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>9.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<distributionManagement>
<repository>
<id>zyneonstudios-repo</id>
<url>https://maven.zyneonstudios.com/releases</url>
<url>https://maven.zyneonstudios.com/snapshots</url>
</repository>
</distributionManagement>

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/zyneonstudios/nexus/utilities/events/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.zyneonstudios.nexus.utilities.events;

import java.util.UUID;

public interface Event {

UUID getUUID();

boolean execute();
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
package com.zyneonstudios.nexus.utilities.storage;

import java.util.HashMap;
import java.util.UUID;

public class LocalStorage implements EditableStorage {

private final UUID storageID;
private final HashMap<String, Object> storage = new HashMap<>();

public LocalStorage(UUID storageID) {
this.storageID = storageID;
}

public LocalStorage() {
this.storageID = UUID.randomUUID();
}

public UUID getStorageID() {
return storageID;
}

@Override
public boolean has(String path) {
return get(path) != null;
Expand Down Expand Up @@ -103,4 +117,8 @@ public boolean delete(String path) {
return false;
}
}

public void clear() {
storage.clear();
}
}

0 comments on commit 3340f7c

Please sign in to comment.