public static boolean isObjectAvailableNow(final boolean enabled,final Date availableFrom,final Date availableTo,final Date now){
  if (!enabled) {
    return false;
  }
  if (availableFrom != null && now.before(availableFrom)) {
    return false;
  }
  if (availableTo != null && now.after(availableTo)) {
    return false;
  }
  return true;
}

public static boolean isObjectAvailableNow ( final boolean enabled , final Date availableFrom , final Date availableTo , final Date now ) { if ( ! enabled ) { return false ; } if ( availableFrom != null && now . before ( availableFrom ) ) { return false ; } if ( availableTo != null && now . after ( availableTo ) ) { return false ; } return true ; }
check availability of an object .
