Package javax.cache

Class CacheConfiguration.Duration

    • Constructor Detail

      • Duration

        public Duration​(TimeUnit timeUnit,
                        long durationAmount)
        Constructs a duration.
        Parameters:
        timeUnit - the unit of time to specify time in. The minimum time unit is milliseconds.
        durationAmount - how long, in the specified units, the cache entries should live. 0 means eternal.
        Throws:
        NullPointerException - if timeUnit is null
        IllegalArgumentException - if durationAmount is less than 0 or a TimeUnit less than milliseconds is specified
    • Method Detail

      • getTimeUnit

        public TimeUnit getTimeUnit()
        Returns:
        the TimeUnit used to specify this duration
      • getDurationAmount

        public long getDurationAmount()
        Returns:
        the number of TimeUnits which quantify this duration
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object