-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to create cache if missing via CachedBy (#89)
- Loading branch information
Showing
3 changed files
with
66 additions
and
12 deletions.
There are no files selected for viewing
29 changes: 28 additions & 1 deletion
29
...framework-core/src/main/java/com/antelopesystem/crudframework/crud/annotation/CachedBy.kt
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 |
---|---|---|
@@ -1,4 +1,31 @@ | ||
package com.antelopesystem.crudframework.crud.annotation | ||
|
||
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS) | ||
annotation class CachedBy(val value: String) | ||
annotation class CachedBy( | ||
/** | ||
* The name of the cache | ||
*/ | ||
val value: String, | ||
/** | ||
* Whether or not to create a cache with this name if the cache does not exist | ||
*/ | ||
val createIfMissing: Boolean = false, | ||
|
||
/** | ||
* Specifies time to live in seconds when creating the cache if missing, may not be supported on all providers. | ||
* -1 is interpret as null | ||
*/ | ||
val timeToLiveSeconds: Long = -1L, | ||
|
||
/** | ||
* Specifies time to idle in seconds when creating the cache if missing, may not be supported on all providers | ||
* -1 is interpret as null | ||
*/ | ||
val timeToIdleSeconds: Long = -1L, | ||
|
||
/** | ||
* Specifies max cache entries when creating the cache if missing, may not be supported on all providers | ||
* -1 is interpret as null | ||
*/ | ||
val maxEntries: Long = -1 | ||
) |
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