package com.andyadc.idea4j.plugin.cache;

/**
 * @author andaicheng
 * @version 2016/10/18
 */
public enum Expiry {

    ETERNAL(-1L), ZERO(0), ONE_MINUTE(60 * 1000L), FIVE_MINUTES(5 * 60 * 1000L), ONE_HOUR(60 * 60 * 1000L), ONE_DAY(24 * 60 * 60 * 1000L);

    private long duration;

    Expiry(long duration) {
        this.duration = duration;
    }

    public long getDuration() {
        return duration;
    }
}

@@ -99,12 +99,13 @@
 lic 
-enum
+class
  Exp
@@ -119,30 +119,114 @@
     
-ETERNAL(-1L), ZERO(0),
+public static final long ETERNAL = -1;%0A    public static final long ZERO = 0;%0A    public static final long
  ONE
@@ -232,17 +232,19 @@
 E_MINUTE
-(
+ = 
 60 * 100
@@ -249,258 +249,303 @@
 000L
-), FIVE_MINUTES(5 * 60 * 1000L), ONE_HOUR(60 * 60 * 1000L), ONE_DAY(24 * 60 * 60 * 1000L);%0A%0A    private long duration;%0A%0A    Expiry(long duration) %7B%0A        this.duration = duration;%0A    %7D%0A%0A    public long getDuration() %7B%0A        return duration;%0A    %7D
+;%0A    public static final long FIVE_MINUTES = 5 * ONE_MINUTE;%0A    public static final long TEN_MINUTES = 10 * ONE_MINUTE;%0A    public static final long THIRTY_MINUTES = 30 * ONE_MINUTE;%0A    public static final long ONE_HOUR = 60 * ONE_MINUTE;%0A    public static final long ONE_DAY = 24 * ONE_HOUR;%0A
 %0A%7D%0A

optimize code