We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b98c96 commit 05cb242Copy full SHA for 05cb242
1 file changed
objectcache/src/main/java/com/myntra/objectcache/Expiry.java
@@ -0,0 +1,22 @@
1
+package com.myntra.objectcache;
2
+
3
+import java.util.concurrent.TimeUnit;
4
5
+/**
6
+ * @author mario
7
+ * A small helper class to set expiry for the cache
8
+ */
9
+public class Expiry {
10
+ public static long MINUTES(long minutes) {
11
+ return TimeUnit.MINUTES.toMillis(minutes);
12
+ }
13
+ public static long SECONDS(long seconds) {
14
+ return TimeUnit.SECONDS.toMillis(seconds);
15
16
+ public static long HOURS(long hours) {
17
+ return TimeUnit.HOURS.toMillis(hours);
18
19
+ public static long DAYS(long days) {
20
+ return TimeUnit.DAYS.toMillis(days);
21
22
+}
0 commit comments