Skip to content

Commit

Permalink
feat(api): cache
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Sep 25, 2022
1 parent 6bdf516 commit 4154800
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/auioc/mcmod/arnicalib/api/java/cache/Cache.java
@@ -0,0 +1,11 @@
package org.auioc.mcmod.arnicalib.api.java.cache;

public interface Cache<K, V> {

V get(K key);

void put(K key, V value);

void clear();

}
@@ -0,0 +1,15 @@
package org.auioc.mcmod.arnicalib.api.java.cache;

import javax.annotation.Nonnull;

public interface LoadingCache<K, V> extends Cache<K, V> {

@Nonnull
V load(K key);

@Override
default void put(K key, V value) {
throw new UnsupportedOperationException();
}

}

0 comments on commit 4154800

Please sign in to comment.