class DomainApiUtils {

    public static boolean isObjectAvailableNow(final boolean enabled,
                                               final LocalDateTime availableFrom,
                                               final LocalDateTime availableTo,
                                               final LocalDateTime now) {

        if (!enabled) {
            return false;
        }

        if (availableFrom != null && now.isBefore(availableFrom)) {
            return false;
        }

        if (availableTo != null && now.isAfter(availableTo)) {
            return false;
        }

        return true;

    }

    private  DomainApiUtils();

}