-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add cache to storage (default cache is none) * set minimum sdk version to 8 * update tests * update benchmark
- Loading branch information
1 parent
204db43
commit 74ee04c
Showing
10 changed files
with
469 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.fabianterhorst.iron; | ||
|
||
public interface Cache { | ||
|
||
void evictAll(); | ||
|
||
Object put(String key, Object value); | ||
|
||
Object get(String key); | ||
|
||
Object remove(String key); | ||
|
||
void setStorage(Storage storage); | ||
|
||
Object create(String key); | ||
|
||
Cache NONE = new Cache() { | ||
|
||
Storage storage; | ||
|
||
@Override | ||
public void evictAll() { | ||
} | ||
|
||
@Override | ||
public Object create(String key) { | ||
return storage.doSelect(key); | ||
} | ||
|
||
@Override | ||
public Object put(String key, Object value) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Object get(String key) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Object remove(String key) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void setStorage(Storage storage) { | ||
this.storage = storage; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.