Here you can find the source of isValidTTL(final Integer ttlDurationInSeconds)
public static boolean isValidTTL(final Integer ttlDurationInSeconds)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.TimeUnit; public class Main { public static boolean isValidTTL(final Integer ttlDurationInSeconds) { if (ttlDurationInSeconds == null) { return false; }// w w w . j a va 2s .co m return isValidTTL(TimeUnit.SECONDS, ttlDurationInSeconds); } public static boolean isValidTTL(final TimeUnit timeUnit, final Integer ttlDuration) { if (timeUnit == null || ttlDuration == null) { return false; } if (timeUnit.toSeconds(ttlDuration) <= 0) { return false; } if (timeUnit.toSeconds(ttlDuration) > Integer.MAX_VALUE) { return false; } return true; } }