Package javax.util.jcache

Examples of javax.util.jcache.InvalidArgumentException


     * @throws InvalidArgumentException if a negative value for idle is
     *             supplied.
     */
    public void setIdleTime(final long idle) throws InvalidArgumentException {
        if (idle < 0) {
            throw new InvalidArgumentException("Idle time must be a positive number.");
        }
        this.idleTime = idle;
    }
View Full Code Here


     *
     * @throws InvalidArgumentException if a negative value for ttl is supplied.
     */
    public void setTimeToLive(final long ttl) throws InvalidArgumentException {
        if (ttl < 0) {
            throw new InvalidArgumentException("Time to live must be a positive number.");
        }
        this.timeToLive = ttl;
    }
View Full Code Here

     * @throws InvalidArgumentException if any of the parameters are negative
     *             values.
     */
    public long timeToSeconds(final int days, final int hours, final int minutes, final int seconds) throws InvalidArgumentException {
        if (days < 0) {
            throw new InvalidArgumentException("Days must be larger than zero.");
        }
        if (hours < 0) {
            throw new InvalidArgumentException("Hours must be larger than zero.");
        }
        if (minutes < 0) {
            throw new InvalidArgumentException("Minutes must be larger than zero.");
        }
        if (seconds < 0) {
            throw new InvalidArgumentException("Seconds must be larger than zero.");
        }
        return seconds + (ONE_MINUTE * minutes) + (ONE_MINUTE * ONE_HOUR * hours) + (ONE_MINUTE * ONE_HOUR * ONE_DAY * days);
    }
View Full Code Here

TOP

Related Classes of javax.util.jcache.InvalidArgumentException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.