Example usage for java.util Date compareTo

List of usage examples for java.util Date compareTo

Introduction

In this page you can find the example usage for java.util Date compareTo.

Prototype

public int compareTo(Date anotherDate) 

Source Link

Document

Compares two Dates for ordering.

Usage

From source file:com.odoo.orm.OSyncHelper.java

/**
 * Check for local latest updated records. If result is from call_kw than
 * ignoring it./* w  ww . jav a2 s. c om*/
 * 
 * @param model
 *            the model
 * @param result
 *            the result
 * @return records object, which are new on server or latest updated on
 *         server
 */
public JSONObject checkForLocalLatestUpdate(OModel model, JSONObject result) {
    JSONObject newResult = result;
    try {
        if (result.has("records") && result.getJSONArray("records").length() > 0) {
            newResult = new JSONObject();
            JSONArray newORUpdateRecords = new JSONArray();
            JSONArray records = result.getJSONArray("records");
            List<Integer> mCheckIds = new ArrayList<Integer>();
            HashMap<String, JSONObject> record_list = new HashMap<String, JSONObject>();
            model.checkInActiveRecord(true);
            for (int i = 0; i < records.length(); i++) {
                JSONObject record = records.getJSONObject(i);
                if (model.hasRecord(record.getInt("id"))) {
                    mCheckIds.add(record.getInt("id"));
                    record_list.put("key_" + record.getInt("id"), record);
                } else {
                    // New record.
                    newORUpdateRecords.put(record);
                }
            }
            List<ODataRow> updateToServerRecordList = new ArrayList<ODataRow>();
            if (mCheckIds.size() > 0) {
                // Getting write_date for records
                HashMap<String, String> write_dates = getWriteDate(model, mCheckIds);
                for (Integer id : mCheckIds) {
                    String key = "KEY_" + id;
                    String write_date = write_dates.get(key);
                    ODataRow record = model.select("id = ? ", new Object[] { id }).get(0);
                    String local_write_date = record.getString("local_write_date");

                    Date local_date = ODate.convertToDate(local_write_date, ODate.DEFAULT_FORMAT, true);
                    Date server_date = ODate.convertToDate(write_date, ODate.DEFAULT_FORMAT, true);

                    if (local_date.compareTo(server_date) > 0) {
                        updateToServerRecordList.add(record);
                    } else {
                        newORUpdateRecords.put(record_list.get("key_" + id));
                    }
                }
            }
            if (updateToServerRecordList.size() > 0) {
                updateRecordOnServer(model, updateToServerRecordList);
            }
            Log.v(TAG, newORUpdateRecords.length() + " records new/update in local");
            newResult.accumulate("records", newORUpdateRecords);
            model.checkInActiveRecord(false);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return newResult;
}

From source file:com.aurel.track.linkType.MsProjectLinkTypeBL.java

/**
 * This method saves work items new start/end date in case of drag and drop, resizing and cascades dependent work items in case.
 * New start and end date is in startDate and endDate attribute.
 * Bryntum increase end date with one day: for ex. work item start date: 2013-11-25 and the duration is 3 days => the end date is: 2013-11-29
 * Because Bryntum increase end date with one day when saving new start/end date it must be reduced with one day.
 * (In proper method when returning the JSON for bryntum the endDate must be increased with one day!)
 * The bean contains reduced interval, the parameters (startDate, endDate) contains increased, Bryntum compatible interval.
 * This method checks moved work item and his preds violation,  in case returns proper error message.
 * @param workItemBean//w w  w.j a  va2 s  .  c  o m
 * @param startDateParam
 * @param endDateParam
 * @param sessionParam
 * @param localeParam
 * @param removeViolatedLinksAndCascade
 * @param wrongDependencies
 * @param msProjectIdMapParam
 * @param personBeanParam
 * @param servletResponse
 * @return
 */
public static void planItem(TWorkItemBean workItemBean, Date oldStartDate, Date oldEndDate, Date startDate,
        Date endDate, Locale locale, List<Integer> msProjectLinkTypeIDs, Integer personID,
        boolean storeCurrentWorkitem) {
    Integer workItemID = workItemBean.getObjectID();
    Map<Integer, WorkItemWithNewCascadedDates> itemCascadeMap = new HashMap<Integer, WorkItemWithNewCascadedDates>();
    int numberOfMovedDays = 0;
    int numberOfWorkedDaysFromMovedDays = 0;
    if (workItemBean.isMilestone()) {
        setEndDate(workItemBean, getStartDate(workItemBean));
        endDate = startDate;
    }
    boolean onlyStartDateChanged = false;
    try {
        if (startDate != null && endDate != null && oldStartDate != null && oldEndDate != null) {

            if (oldStartDate.compareTo(startDate) != 0 && oldEndDate.compareTo(endDate) != 0) {
                numberOfMovedDays = getNumberOfDaysBetweenDates(oldStartDate, startDate, false);
                if (numberOfMovedDays < 0) {
                    numberOfWorkedDaysFromMovedDays = getNumberOfWorkDaysFromMovedIntervall(endDate,
                            oldEndDate);
                } else {
                    numberOfWorkedDaysFromMovedDays = getNumberOfWorkDaysFromMovedIntervall(oldStartDate,
                            startDate);
                }
            } else {
                if (oldStartDate.compareTo(startDate) != 0) {
                    numberOfMovedDays = getNumberOfDaysBetweenDates(oldStartDate, startDate, false);
                    onlyStartDateChanged = true;
                    if (numberOfMovedDays < 0) {
                        numberOfWorkedDaysFromMovedDays = getNumberOfWorkDaysFromMovedIntervall(startDate,
                                oldStartDate);
                    } else {
                        numberOfWorkedDaysFromMovedDays = getNumberOfWorkDaysFromMovedIntervall(oldStartDate,
                                startDate);
                    }
                }
                if (oldEndDate.compareTo(endDate) != 0) {
                    numberOfMovedDays = getNumberOfDaysBetweenDates(oldEndDate, endDate, false);
                    if (numberOfMovedDays < 0) {
                        numberOfWorkedDaysFromMovedDays = getNumberOfWorkDaysFromMovedIntervall(endDate,
                                oldEndDate);
                    } else {
                        numberOfWorkedDaysFromMovedDays = getNumberOfWorkDaysFromMovedIntervall(oldEndDate,
                                endDate);
                    }
                }
            }
            if (numberOfWorkedDaysFromMovedDays < 0) {
                numberOfWorkedDaysFromMovedDays = Math.abs(numberOfWorkedDaysFromMovedDays);
            }
            if (!onlyStartDateChanged) {
                cascadeWorkItemChanges(workItemBean, numberOfWorkedDaysFromMovedDays, numberOfMovedDays,
                        personID, locale, itemCascadeMap, msProjectLinkTypeIDs, workItemID, startDate, endDate,
                        storeCurrentWorkitem);
            }
        }
    } catch (Exception ex) {
        LOGGER.error("Error: " + ex.getMessage());
        if (LOGGER.isDebugEnabled()) {
            LOGGER.error(ExceptionUtils.getStackTrace(ex));
        }
    }
}

From source file:org.libreplan.web.resources.worker.WorkerCRUDController.java

public Constraint checkConstraintStartDate() {
    return (comp, value) -> {
        Date startDate = (Date) value;
        if ((startDate != null) && (filterFinishDate.getValue() != null)
                && (startDate.compareTo(filterFinishDate.getValue()) > 0)) {
            filterStartDate.setValue(null);
            throw new WrongValueException(comp, _("must be lower than end date"));
        }/*from  w w  w. j  a  va2 s. c om*/
    };
}

From source file:org.libreplan.web.resources.worker.WorkerCRUDController.java

/**
 * Operations to filter the machines by multiple filters
 *//*  w  ww .j  a  v  a2 s .c om*/

public Constraint checkConstraintFinishDate() {
    return (comp, value) -> {
        Date finishDate = (Date) value;
        if ((finishDate != null) && (filterStartDate.getValue() != null)
                && (finishDate.compareTo(filterStartDate.getValue()) < 0)) {
            filterFinishDate.setValue(null);
            throw new WrongValueException(comp, _("must be after start date"));
        }
    };
}

From source file:org.kuali.kfs.module.tem.document.validation.impl.TravelAuthTravelerValidation.java

@Override
public boolean validate(AttributedDocumentEvent event) {
    GlobalVariables.getMessageMap().clearErrorPath();
    GlobalVariables.getMessageMap().addToErrorPath(TRIP_OVERVIEW);

    TravelDocumentBase doc = (TravelDocumentBase) event.getDocument();
    Date beginDate = doc.getTripBegin();
    Date endDate = doc.getTripEnd();
    TravelerDetail traveler = doc.getTraveler();

    GlobalVariables.getMessageMap().addToErrorPath(TemPropertyConstants.TRAVELER);
    if (ObjectUtils.isNotNull(traveler) && ObjectUtils.isNotNull(traveler.getTravelerTypeCode())) {
        if (traveler.getTravelerTypeCode().equals(TemConstants.EMP_TRAVELER_TYP_CD)
                && ObjectUtils.isNull(traveler.getPrincipalId())) {
            GlobalVariables.getMessageMap().putError(
                    KFSConstants.DOCUMENT_PROPERTY_NAME + "." + TravelAuthorizationFields.TRAVELER_PRINCIPAL_ID,
                    KFSKeyConstants.ERROR_REQUIRED, "Principal Id");
        }/*from   w w  w. j a va2  s . co  m*/

        if (shouldValidateAddress(traveler.getCountryCode(), traveler.getStateCode())) {
            getPostalCodeValidationService().validateAddress(traveler.getCountryCode(), traveler.getStateCode(),
                    traveler.getZipCode(), "stateCode", "zipCode");
        }
    }

    GlobalVariables.getMessageMap().removeFromErrorPath(TemPropertyConstants.TRAVELER);

    if (endDate != null && beginDate != null && endDate.compareTo(beginDate) < 0) {
        GlobalVariables.getMessageMap().putError(TemPropertyConstants.TRIP_BEGIN_DT,
                ERROR_TA_AUTH_END_DATE_BEFORE_BEGIN);
    }

    GlobalVariables.getMessageMap().removeFromErrorPath(TRIP_OVERVIEW);

    int errCount = GlobalVariables.getMessageMap().getErrorCount();
    if (errCount > 0) {
        return false;
    }

    return true;
}

From source file:org.rapidandroid.activity.chart.form.FormDataBroker.java

private JSONGraphData loadBooleanPlot() {

    Date startDateToUse = getStartDate();
    DateDisplayTypes displayType = this.getDisplayType(startDateToUse, mEndDate);

    String selectionArg = getSelectionString(displayType);

    StringBuilder rawQuery = new StringBuilder();

    String fieldcol = RapidSmsDBConstants.FormData.COLUMN_PREFIX + fieldToPlot.getName();

    rawQuery.append("select time, " + fieldcol + ", count(*) from  ");
    rawQuery.append(RapidSmsDBConstants.FormData.TABLE_PREFIX + mForm.getPrefix());

    rawQuery.append(" join rapidandroid_message on (");
    rawQuery.append(RapidSmsDBConstants.FormData.TABLE_PREFIX + mForm.getPrefix());
    rawQuery.append(".message_id = rapidandroid_message._id");
    rawQuery.append(") ");
    if (startDateToUse.compareTo(Constants.NULLDATE) != 0 && mEndDate.compareTo(Constants.NULLDATE) != 0) {
        rawQuery.append(" WHERE rapidandroid_message.time > '" + Message.SQLDateFormatter.format(startDateToUse)
                + "' AND rapidandroid_message.time < '" + Message.SQLDateFormatter.format(mEndDate) + "' ");
    }/*from ww  w. ja va2  s. co  m*/

    rawQuery.append(" group by ").append(selectionArg).append(", " + fieldcol);
    rawQuery.append(" order by ").append("time").append(" ASC");

    SQLiteDatabase db = rawDB.getReadableDatabase();
    // the string value is column 0
    // the magnitude is column 1
    Log.d("query", rawQuery.toString());
    Cursor cr = db.rawQuery(rawQuery.toString(), null);
    // TODO Auto-generated method stub
    int barCount = cr.getCount();
    Date[] allDates = new Date[barCount];
    if (barCount == 0) {
        db.close();
        cr.close();
    } else {
        List<Date> xValsTrue = new ArrayList<Date>();
        // Date[] xValsTrue = new Date[barCount];
        List<Integer> yValsTrue = new ArrayList<Integer>();
        List<Date> xValsFalse = new ArrayList<Date>();
        // Date[] xValsTrue = new Date[barCount];
        List<Integer> yValsFalse = new ArrayList<Integer>();
        cr.moveToFirst();
        int i = 0;
        do {
            String trueFalse = cr.getString(1);
            // int trueFalse2 = cr.getInt(fieldcol);
            // String trueFalseStr = cr.getString(1);

            Date thisDate = getDate(displayType, cr.getString(0));
            Log.d("FormDataBroker: ", cr.getString(0) + ", " + trueFalse + " , " + cr.getInt(2));

            if (trueFalse.equals("true")) {
                xValsFalse.add(thisDate);
                yValsFalse.add(new Integer(cr.getInt(2)));
            } else {
                xValsTrue.add(thisDate);
                yValsTrue.add(new Integer(cr.getInt(2)));
            }
            allDates[i] = thisDate;
            i++;
        } while (cr.moveToNext());

        try {
            //            String legend = this.getLegendString(displayType);
            int[] yVals = getIntsFromList(yValsTrue);
            JSONArray trueArray = getJSONArrayForValues(displayType, xValsTrue.toArray(new Date[0]), yVals);
            yVals = getIntsFromList(yValsFalse);
            JSONArray falseArray = getJSONArrayForValues(displayType, xValsFalse.toArray(new Date[0]), yVals);
            JSONArray finalValues = new JSONArray();
            JSONObject trueElem = new JSONObject();
            trueElem.put("data", trueArray);
            trueElem.put("label", "Yes");
            trueElem.put("lines", getShowTrue());
            finalValues.put(trueElem);
            JSONObject falseElem = new JSONObject();
            falseElem.put("data", falseArray);
            falseElem.put("label", "No");
            falseElem.put("lines", getShowTrue());
            finalValues.put(falseElem);
            return new JSONGraphData(finalValues, loadOptionsForDateGraph(allDates, true, displayType));

        } catch (Exception ex) {

        } finally {
            if (!cr.isClosed()) {

                cr.close();
            }
            if (db.isOpen()) {
                db.close();
            }
        }
    }
    // either there was no data or something bad happened
    return new JSONGraphData(getEmptyData(), new JSONObject());
}

From source file:org.libreplan.importers.MPXJProjectFileConversor.java

/**
 * Private Method/*w  ww .  j  a  v  a 2 s  .c  o  m*/
 *
 * Get a list of {@link CalendarWeekDTO} from a list of ProjectCalendarWeek.
 *
 * @param projectCalendar
 *            ProjectCalendarWeek with the default data
 * @param workWeeks
 *            List of ProjectCalendarWeek to extract data from.Assume that is ordered
 *            for its DataRange start date.
 * @return List<CalendarDataDTO> List with the CalendarDatas that we want to import.
 */
private static List<CalendarWeekDTO> getCalendarWeekDTOs(ProjectCalendar projectCalendar,
        List<ProjectCalendarWeek> workWeeks) {

    List<CalendarWeekDTO> calendarDataDTOs = new ArrayList<CalendarWeekDTO>();

    Date startCalendarDate;
    Date endCalendarDate;

    if (projectCalendar.getDateRange() == null) {
        startCalendarDate = projectCalendar.getParentFile().getProjectHeader().getStartDate();
        endCalendarDate = projectCalendar.getParentFile().getProjectHeader().getFinishDate();

    } else {
        startCalendarDate = projectCalendar.getDateRange().getStart();
        endCalendarDate = projectCalendar.getDateRange().getEnd();

    }

    if (workWeeks.size() == 0) {
        calendarDataDTOs.add(toCalendarWeekDTO(startCalendarDate, endCalendarDate, projectCalendar));
    } else {

        // TODO This utility is not currently implemented in MPXJ
        // This one is going to represent all the work weeks. Including the
        // ones
        // with the default value that are in the middle of two.

        Date firsWorkWeekCalendarDate = workWeeks.get(0).getDateRange().getStart();
        Calendar calendar1 = Calendar.getInstance();
        Calendar calendar2 = Calendar.getInstance();

        // If the star of the first work week is after the start of the
        // default
        // we have to fill the hole
        if (startCalendarDate.compareTo(firsWorkWeekCalendarDate) < 0) {
            calendar1.setTime(firsWorkWeekCalendarDate);
            calendar1.set(Calendar.DAY_OF_MONTH, -1);
            calendarDataDTOs.add(toCalendarWeekDTO(startCalendarDate, calendar1.getTime(), projectCalendar));
        }

        Date startDate;
        Date endDate;
        Date nextStartDate;

        int j;
        for (int i = 0; i < workWeeks.size(); i++) {
            startDate = workWeeks.get(i).getDateRange().getStart();
            endDate = workWeeks.get(i).getDateRange().getEnd();
            calendarDataDTOs.add(toCalendarWeekDTO(startDate, endDate, workWeeks.get(i)));

            j = i + 1;
            // If is not the last one
            if (j < workWeeks.size()) {
                nextStartDate = workWeeks.get(i + 1).getDateRange().getStart();
                calendar1.setTime(endDate);
                calendar1.set(Calendar.DAY_OF_MONTH, +1);
                // If the end of the current work week is more than one day
                // before
                // the beginning of the next
                if (calendar1.getTime().compareTo(nextStartDate) < 0) {
                    calendar2.setTime(nextStartDate);
                    calendar1.set(Calendar.DAY_OF_MONTH, -1);
                    // Adds a new default calendar week in the hole
                    calendarDataDTOs
                            .add(toCalendarWeekDTO(calendar1.getTime(), calendar2.getTime(), projectCalendar));
                }
            }
        }

        Date endWorkWeekCalendarDate = workWeeks.get(workWeeks.size()).getDateRange().getEnd();

        // If the end of the last work week is earlier than the end of the
        // default we have to fill the hole
        if (endCalendarDate.compareTo(endWorkWeekCalendarDate) > 0) {
            calendar1.setTime(endWorkWeekCalendarDate);
            calendar1.set(Calendar.DAY_OF_MONTH, +1);
            calendarDataDTOs.add(toCalendarWeekDTO(calendar1.getTime(), endCalendarDate, projectCalendar));
        }

    }

    return calendarDataDTOs;
}

From source file:org.openremote.beehive.api.service.impl.SVNDelegateServiceImpl.java

/**
 * {@inheritDoc}/*from ww  w. j a va2s . c o m*/
 */
public Actions compareFileByLastModifiedDate(LIRCElement lirc) {
    Actions action = Actions.NORMAL;
    File workFile = new File(
            StringUtil.appendFileSeparator(configuration.getWorkCopyDir()) + lirc.getRelativePath());
    if (workFile.exists()) {
        try {
            Date uploadDate = lirc.getUploadDate();
            boolean underSVN = false;
            for (String fileName : workFile.getParentFile().list()) {
                if (".svn".equals(fileName)) {
                    underSVN = true;
                    break;
                }
            }
            if (underSVN) {
                ISVNInfo svnInfo = svnClient
                        .getInfoFromWorkingCopy(new File(SvnUtil.escapeFileName(workFile.getAbsolutePath())));
                if (svnInfo.getLastChangedDate() != null
                        && uploadDate.compareTo(svnInfo.getLastChangedDate()) > 0) {
                    action = Actions.MODIFIED;
                }
            } else if (uploadDate.compareTo(new Date(workFile.lastModified())) > 0) {
                action = Actions.MODIFIED;
            }
        } catch (SVNClientException e) {
            logger.error("Get file " + workFile.getName()
                    + " info error, this may occur by the fileName not case sensitive!", e);
            SVNException ee = new SVNException("Get file " + workFile.getName()
                    + " info error, this may occur by the fileName not case sensitive!", e);
            ee.setErrorCode(SVNException.SVN_GETINFO_ERROR);
            throw ee;
        }
    } else {
        action = Actions.ADDED;
    }
    return action;
}

From source file:org.opensingular.internal.lib.commons.xml.TestMElement.java

License:asdf

@Test
public void addDiferentTypesOfElements() {
    Calendar calendar = ConversorToolkit.getCalendar("01/01/2017");

    MElement raiz = MElement.newInstance("raiz");

    raiz.addElement("bytesOfString", "valor".getBytes());
    raiz.addElement("calendar", calendar);
    raiz.addElement("date", calendar.getTime());
    raiz.addElement("longValue", (long) 123);
    raiz.addElement("doubles", 123.45);
    raiz.addElement("simpleString", "valores");
    raiz.addElement("outraString", "valor", "val");
    raiz.addElement("doublePrecision", 123456.700, 1);

    GregorianCalendar calendarMElement = raiz.getCalendar("calendar");
    Assert.assertEquals(0, calendar.compareTo(calendarMElement));

    Date date = raiz.getDate("date");
    Assert.assertEquals(0, date.compareTo(calendar.getTime()));

    long longValue = raiz.getLong("longValue");
    Assert.assertEquals(longValue, (long) 123);

    double doubles = raiz.getDouble("doubles");
    Assert.assertEquals(doubles, 123.45, 0);

    String simpleString = raiz.getValor("simpleString");
    Assert.assertEquals(simpleString, "valores");

    String outraString = raiz.getValor("outraString");
    Assert.assertEquals(outraString, "valor");

    double doublePrecision = raiz.getDouble("doublePrecision");
    Assert.assertEquals(doublePrecision, 123456.7, 0);

    raiz.addElement("dateIgnoringDefault", calendar.getTime(), calendar.getTime());
    Date dateIgnoringDefault = raiz.getDate("dateIgnoringDefault");
    Assert.assertEquals(0, dateIgnoringDefault.compareTo(calendar.getTime()));

    raiz.addElement("dateUsingDefault", null, calendar.getTime());
    Date dateUsingDefault = raiz.getDate("dateUsingDefault");
    Assert.assertEquals(0, dateUsingDefault.compareTo(calendar.getTime()));

    Date dataNull = null;/*from w w w  .j  a  v  a 2  s .  c  o  m*/
    raiz.addElement("dateUsingDefaultWithAllNull", null, dataNull);
    Date dateUsingDefaultWithAllNull = raiz.getDate("dateUsingDefaultWithAllNull");
    Assert.assertNull(dateUsingDefaultWithAllNull);
}

From source file:nz.net.orcon.kanban.automation.AutomationEngine.java

protected boolean evalProperty(Card card, Condition condition) {
    final Operation operation = condition.getOperation();

    Object cardValue = null;//from w  w  w .  j  a  v  a2s.c  o m
    if (condition.getFieldName().equals("template")) {
        cardValue = card.getTemplate();
    } else if (condition.getFieldName().equals("color")) {
        cardValue = card.getColor();
    } else {
        cardValue = card.getFields().get(condition.getFieldName());
    }

    final List<Object> conditionValues = variableInterpreter.resolveValues(card.getFields(),
            condition.getValue());

    if (cardValue instanceof String) {
        final String stringValue = (String) cardValue;

        switch (operation) {
        case NOTNULL:
            return !StringUtils.isEmpty(stringValue);
        case ISNULL:
            return StringUtils.isEmpty(stringValue);
        }

        for (Object conditionValue : conditionValues) {
            boolean result = false;

            switch (operation) {
            case EQUALTO:
                result = stringValue.equals(conditionValue);
                break;
            case CONTAINS:
                result = stringValue.contains((String) conditionValue);
                break;
            case NOTEQUALTO:
                result = !stringValue.equals(conditionValue);
                break;
            }
            if (result == true)
                return true;
        }
        return false;

    } else if (cardValue instanceof Integer) {

        final double cardValueNumber = getNumberFromObject(cardValue);

        switch (operation) {
        case NOTNULL:
            return true;
        case ISNULL:
            return false;
        }

        for (Object value : conditionValues) {
            final double conditionNumber = getNumberFromObject(value);
            boolean result = false;

            switch (operation) {
            case EQUALTO:
                result = cardValueNumber == conditionNumber;
                break;
            case NOTEQUALTO:
                result = cardValueNumber != conditionNumber;
                break;
            case GREATERTHAN:
                result = cardValueNumber > conditionNumber;
                break;
            case GREATERTHANOREQUALTO:
                result = cardValueNumber >= conditionNumber;
                break;
            case LESSTHAN:
                result = cardValueNumber < conditionNumber;
                break;
            case LESSTHANOREQUALTO:
                result = cardValueNumber <= conditionNumber;
                break;
            }

            if (result)
                return true;
        }
        return false;

    } else if (cardValue instanceof Boolean) {

        boolean cardBoolean = getBooleanFromObject(cardValue);

        switch (operation) {
        case NOTNULL:
            return true;
        case ISNULL:
            return false;
        }

        for (Object value : conditionValues) {

            final boolean conditionBoolean = getBooleanFromObject(value);
            boolean result = false;

            switch (operation) {
            case EQUALTO:
                result = (cardBoolean == conditionBoolean);
                break;
            case NOTEQUALTO:
                result = !(cardBoolean == conditionBoolean);
                break;
            }

            if (result)
                return true;
        }
        return false;

    } else if (cardValue instanceof Date) {

        switch (operation) {
        case NOTNULL:
            return true;
        case ISNULL:
            return false;
        }

        Date cardDate = (Date) cardValue;

        for (Object value : conditionValues) {
            boolean result = false;

            final Date conditionDate = getConditionDate(card, value.toString());

            if (null != conditionDate) {
                int compareDates = cardDate.compareTo(conditionDate);
                switch (operation) {
                case EQUALTO:
                    result = compareDates == 0;
                    break;
                case NOTEQUALTO:
                    result = !(compareDates == 0);
                    break;
                case GREATERTHAN:
                    result = compareDates > 0;
                    break;
                case GREATERTHANOREQUALTO:
                    result = compareDates >= 0;
                    break;
                case LESSTHAN:
                    result = compareDates < 0;
                    break;
                case LESSTHANOREQUALTO:
                    result = compareDates <= 0;
                    break;
                case BEFORE:
                    result = compareDates < 0;
                    break;
                case AFTER:
                    result = compareDates > 0;
                    break;
                }
            }
            if (result)
                return true;
        }
        return false;
    } else {
        if (cardValue != null) {
            LOG.warn("Condition Data Type not Recognized: " + condition.getFieldName() + " type "
                    + cardValue.getClass().getName());
        } else {
            switch (operation) {
            case NOTNULL:
                return false;
            case ISNULL:
                return true;
            case NOTEQUALTO:
                return true;
            }
        }
    }
    return false;
}