Example usage for org.apache.commons.lang3.math NumberUtils toLong

List of usage examples for org.apache.commons.lang3.math NumberUtils toLong

Introduction

In this page you can find the example usage for org.apache.commons.lang3.math NumberUtils toLong.

Prototype

public static long toLong(final String str) 

Source Link

Document

Convert a String to a long, returning zero if the conversion fails.

If the string is null, zero is returned.

 NumberUtils.toLong(null) = 0L NumberUtils.toLong("")   = 0L NumberUtils.toLong("1")  = 1L 

Usage

From source file:io.wcm.config.core.impl.ParameterOverrideProviderBridge.java

private String toJsonValue(String value, Class type) {
    if (type.isArray()) {
        return "[" + toJsonValue(value, type.getComponentType()) + "]";
    } else if (type == String.class) {
        return JSONObject.quote(value);
    } else if (type == int.class) {
        return Integer.toString(NumberUtils.toInt(value));
    } else if (type == long.class) {
        return Long.toString(NumberUtils.toLong(value));
    } else if (type == double.class) {
        return Double.toString(NumberUtils.toDouble(value));
    } else if (type == boolean.class) {
        return Boolean.toString(BooleanUtils.toBoolean(value));
    } else {/* w w w. j a  v  a2 s  . c o m*/
        throw new IllegalArgumentException("Illegal value type: " + type.getName());
    }
}

From source file:com.smartqa.utils.WebDriverUtils.java

/**
 * help to calculate performance time/*from w  w  w . j  ava 2s. c o  m*/
 * 
 * @param startKey
 * @param endKey
 * @param timeMap
 * @return performance time
 */
private static Long getTime(String startKey, String endKey, Map<String, String> timeMap) {
    try {
        long startTime = NumberUtils.toLong(timeMap.get(startKey));
        long endTime = NumberUtils.toLong(timeMap.get(endKey));
        return (endTime - startTime);
    } catch (Exception ex) {
        return -1L;
    }
}

From source file:de.micromata.genome.gwiki.controls.GWikiPageInfoActionBean.java

public static String formatAttachmentSize(String size) {
    if (NumberUtils.isDigits(size) == false) {
        return size;
    }//from  w  w  w. j  a  va2s  .  co  m
    long numb = NumberUtils.toLong(size);
    DecimalFormat nf = new DecimalFormat();
    String ret = nf.format(numb);
    return ret;
}

From source file:com.dominion.salud.mpr.negocio.report.tratamientos.impl.DispensacionesReportImpl.java

/**
 *
 * @param parametros//from  w w  w  . java 2  s  . com
 * @return
 * @throws com.dominion.salud.mpr.negocio.service.exception.InformeSinDatosException
 * @throws com.dominion.salud.mpr.negocio.service.exception.InformeException
 */
@Override
public String listadoDispensacionDetalladoReport(Map<String, Object> parametros)
        throws InformeSinDatosException, InformeException {
    logger.debug("Generando el listado: " + MPR_LISTADO_DISPENSACIONES_DETALLADO);

    logger.debug("     Parametros del listado: ");
    logger.debug("          idAcuerdo: " + parametros.get("idAcuerdo"));
    logger.debug("          txtAcuerdo: " + parametros.get("txtAcuerdo"));
    logger.debug("          idCentro: " + parametros.get("idCentro"));
    logger.debug("          txtCentro: " + parametros.get("txtCentro"));
    logger.debug("          fecIniDisp: " + parametros.get("fecIniDisp"));
    logger.debug("          fecFinDisp: " + parametros.get("fecFinDisp"));

    //CONVERSION DE PARAMETROS DE ENTRADA
    logger.debug("     Iniciando la conversion de parametros para el listado");
    SimpleDateFormat ddmmyyyy = new SimpleDateFormat("dd/MM/yyyy");
    Date fecIniDisp = null;
    Date fecFinDisp = null;

    try {
        if (StringUtils.isNoneBlank((String) parametros.get("fecIniDisp"))) {
            logger.debug("          Iniciando la conversion de fecIniDisp: "
                    + (String) parametros.get("fecIniDisp"));
            fecIniDisp = ddmmyyyy.parse((String) parametros.get("fecIniDisp"));
            logger.debug("          Conversion de fecIniDisp: " + (String) parametros.get("fecIniDisp")
                    + " realizada correctamente: " + fecIniDisp);
        }
    } catch (ParseException pe) {
        logger.warn("No se ha podido parsear fecIniDisp: " + parametros.get("fecIniDisp"));
    }

    try {
        if (StringUtils.isNoneBlank((String) parametros.get("fecFinDisp"))) {
            logger.debug("          Iniciando la conversion de fecFinDisp: "
                    + (String) parametros.get("fecFinDisp"));
            fecFinDisp = ddmmyyyy.parse((String) parametros.get("fecFinDisp"));
            logger.debug("          Conversion de fecFinDisp: " + (String) parametros.get("fecFinDisp")
                    + " realizada correctamente: " + fecFinDisp);
        }
    } catch (ParseException pe) {
        logger.warn("No se ha podido parsear fecFinDisp: " + parametros.get("fecFinDisp"));
    }

    Long idCentro = null;
    if (StringUtils.isNotBlank((String) parametros.get("idCentro"))) {
        logger.debug("          Iniciando la conversion de idCentro: " + (String) parametros.get("idCentro"));
        idCentro = NumberUtils.toLong((String) parametros.get("idCentro"));
        logger.debug("          Conversion de idCentro: " + (String) parametros.get("idCentro")
                + " realizada correctamente: " + idCentro);
    }

    Long idAcuerdo = null;
    if (StringUtils.isNotBlank((String) parametros.get("idAcuerdo"))) {
        logger.debug("          Iniciando la conversion de idAcuerdo: " + (String) parametros.get("idAcuerdo"));
        idAcuerdo = NumberUtils.toLong((String) parametros.get("idAcuerdo"));
        logger.debug("          Conversion de idAcuerdo: " + (String) parametros.get("idAcuerdo")
                + " realizada correctamente: " + idAcuerdo);
    }
    logger.debug("     Finaliza la conversion de parametros para el listado");

    //OBTENCION DE DATOS PARA POBLAR EL LISTADO
    logger.debug("     Iniciando la obtencion de informacion para el listado");
    List<Dispensaciones> dispensacioneses = new ArrayList<>();
    dispensacioneses = dispensacionesService.findListadoDispensacionesDetallado(idCentro, idAcuerdo, fecIniDisp,
            fecFinDisp);
    logger.debug("          Se han obtenido: " + dispensacioneses.size() + " resultados");
    if (dispensacioneses.size() <= 0) {
        throw new InformeSinDatosException("No se han obtenido resultados");
    }
    logger.debug("     Finaliza la obtencion de informacion para el listado");

    //GENERACION DEL INFORME
    try {
        logger.debug("     Localizando la plantilla del listado: "
                + getClass().getClassLoader().getResource(MPR_LISTADO_DISPENSACIONES_DETALLADO));
        JasperReport reporte = (JasperReport) JRLoader
                .loadObject(getClass().getClassLoader().getResource(MPR_LISTADO_DISPENSACIONES_DETALLADO));
        logger.debug("     Plantilla del listado localizada correctamente");

        logger.debug("     Completando los datos del listado");
        JasperPrint jasperPrint = JasperFillManager.fillReport(reporte, parametros,
                new JRBeanCollectionDataSource(dispensacioneses));
        logger.debug("     Datos del listado completados correctamente");

        logger.debug("     Generando el listado en la ubicacion: " + MPRConstantes._MPR_RESOURCES
                + new Date().getTime() + ".pdf");
        String ruta = reportPDFtoFile(jasperPrint,
                MPRConstantes._MPR_RESOURCES + new Date().getTime() + ".pdf");
        logger.debug("     Listado generado correctamente en la ubicacion: " + ruta);

        logger.debug("Listado: " + MPR_LISTADO_DISPENSACIONES_DETALLADO + " generado correctamente");
        return ruta;
    } catch (Exception e) {
        throw new InformeException(e);
    }
}

From source file:com.xpn.xwiki.XWiki.java

/**
 * Retrieve a specific attachment from the trash.
 * //from ww w .  j a  va2 s .com
 * @param id the unique identifier of the entry in the trash
 * @return specified attachment from the trash, {@code null} if not found
 * @throws XWikiException if an error occurs while loading the attachments
 */
public DeletedAttachment getDeletedAttachment(String id, XWikiContext context) throws XWikiException {
    if (hasAttachmentRecycleBin(context)) {
        return getAttachmentRecycleBinStore().getDeletedAttachment(NumberUtils.toLong(id), context, true);
    }
    return null;
}

From source file:lineage2.gameserver.Config.java

/**
 * Method setField./*from   w ww  .  j  a va  2s . c  om*/
 * @param fieldName String
 * @param value String
 * @return boolean
 */
public static boolean setField(String fieldName, String value) {
    Field field = FieldUtils.getField(Config.class, fieldName);
    if (field == null) {
        return false;
    }
    try {
        if (field.getType() == boolean.class) {
            field.setBoolean(null, BooleanUtils.toBoolean(value));
        } else if (field.getType() == int.class) {
            field.setInt(null, NumberUtils.toInt(value));
        } else if (field.getType() == long.class) {
            field.setLong(null, NumberUtils.toLong(value));
        } else if (field.getType() == double.class) {
            field.setDouble(null, NumberUtils.toDouble(value));
        } else if (field.getType() == String.class) {
            field.set(null, value);
        } else {
            return false;
        }
    } catch (IllegalArgumentException e) {
        return false;
    } catch (IllegalAccessException e) {
        return false;
    }
    return true;
}

From source file:org.apache.jmeter.config.RandomVariableConfig.java

private void init() {
    final String minAsString = getMinimumValue();
    minimum = NumberUtils.toLong(minAsString);
    final String maxAsString = getMaximumValue();
    long maximum = NumberUtils.toLong(maxAsString);
    long rangeL = maximum - minimum + 1; // This can overflow
    if (minimum >= maximum) {
        log.error("maximum(" + maxAsString + ") must be > minimum" + minAsString + ")");
        n = 0;// This is used as an error indicator
        return;/*from  w  w w  .  j ava  2s .co  m*/
    }
    if (rangeL > Integer.MAX_VALUE || rangeL <= 0) {// check for overflow too
        log.warn("maximum(" + maxAsString + ") - minimum" + minAsString + ") must be <=" + Integer.MAX_VALUE);
        rangeL = Integer.MAX_VALUE;
    }
    n = (int) rangeL;
}

From source file:org.apache.syncope.client.console.approvals.Approval.java

public Approval(final PageReference pageRef, final WorkflowFormTO formTO) {
    super(MultilevelPanel.FIRST_LEVEL_ID);

    IModel<List<WorkflowFormPropertyTO>> formProps = new LoadableDetachableModel<List<WorkflowFormPropertyTO>>() {

        private static final long serialVersionUID = 3169142472626817508L;

        @Override//from ww  w. j av  a  2 s .  c  o  m
        protected List<WorkflowFormPropertyTO> load() {
            return formTO.getProperties();
        }
    };

    final ListView<WorkflowFormPropertyTO> propView = new ListView<WorkflowFormPropertyTO>("propView",
            formProps) {

        private static final long serialVersionUID = 9101744072914090143L;

        @Override
        @SuppressWarnings({ "unchecked", "rawtypes" })
        protected void populateItem(final ListItem<WorkflowFormPropertyTO> item) {
            final WorkflowFormPropertyTO prop = item.getModelObject();

            String label = StringUtils.isBlank(prop.getName()) ? prop.getId() : prop.getName();

            FieldPanel field;
            switch (prop.getType()) {
            case Boolean:
                field = new AjaxDropDownChoicePanel("value", label, new PropertyModel<String>(prop, "value") {

                    private static final long serialVersionUID = -3743432456095828573L;

                    @Override
                    public String getObject() {
                        return StringUtils.isBlank(prop.getValue()) ? null
                                : prop.getValue().equals("true") ? "Yes" : "No";
                    }

                    @Override
                    public void setObject(final String object) {
                        prop.setValue(String.valueOf(object.equalsIgnoreCase("yes")));
                    }

                }, false).setChoices(Arrays.asList(new String[] { "Yes", "No" }));
                break;

            case Date:
                final FastDateFormat formatter = FastDateFormat.getInstance(prop.getDatePattern());
                field = new AjaxDateTimeFieldPanel("value", label, new PropertyModel<Date>(prop, "value") {

                    private static final long serialVersionUID = -3743432456095828573L;

                    @Override
                    public Date getObject() {
                        try {
                            if (StringUtils.isBlank(prop.getValue())) {
                                return null;
                            } else {
                                return formatter.parse(prop.getValue());
                            }
                        } catch (ParseException e) {
                            LOG.error("Unparsable date: {}", prop.getValue(), e);
                            return null;
                        }
                    }

                    @Override
                    public void setObject(final Date object) {
                        prop.setValue(formatter.format(object));
                    }

                }, prop.getDatePattern());
                break;

            case Enum:
                MapChoiceRenderer<String, String> enumCR = new MapChoiceRenderer<>(prop.getEnumValues());

                field = new AjaxDropDownChoicePanel("value", label, new PropertyModel<String>(prop, "value"),
                        false).setChoiceRenderer(enumCR).setChoices(new Model<ArrayList<String>>() {

                            private static final long serialVersionUID = -858521070366432018L;

                            @Override
                            public ArrayList<String> getObject() {
                                return new ArrayList<>(prop.getEnumValues().keySet());
                            }
                        });
                break;

            case Long:
                field = new AjaxSpinnerFieldPanel.Builder<Long>().build("value", label, Long.class,
                        new PropertyModel<Long>(prop, "value") {

                            private static final long serialVersionUID = -7688359318035249200L;

                            @Override
                            public Long getObject() {
                                return StringUtils.isBlank(prop.getValue()) ? null
                                        : NumberUtils.toLong(prop.getValue());
                            }

                            @Override
                            public void setObject(final Long object) {
                                prop.setValue(String.valueOf(object));
                            }
                        });
                break;

            case String:
            default:
                field = new AjaxTextFieldPanel("value", label, new PropertyModel<>(prop, "value"), false);
                break;
            }

            field.setReadOnly(!prop.isWritable());
            if (prop.isRequired()) {
                field.addRequiredLabel();
            }

            item.add(field);
        }
    };

    final AjaxLink<String> userDetails = new AjaxLink<String>("userDetails") {

        private static final long serialVersionUID = -4804368561204623354L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            viewDetails(formTO, target);
        }
    };
    MetaDataRoleAuthorizationStrategy.authorize(userDetails, ENABLE, StandardEntitlement.USER_READ);

    final boolean enabled = formTO.getUserTO() != null;
    userDetails.setVisible(enabled).setEnabled(enabled);

    add(propView);
    add(userDetails);
}

From source file:org.apache.syncope.client.console.pages.ApprovalModalPage.java

public ApprovalModalPage(final PageReference pageRef, final ModalWindow window, final WorkflowFormTO formTO) {
    super();//w  w  w  .j  a  va  2 s . com

    IModel<List<WorkflowFormPropertyTO>> formProps = new LoadableDetachableModel<List<WorkflowFormPropertyTO>>() {

        private static final long serialVersionUID = 3169142472626817508L;

        @Override
        protected List<WorkflowFormPropertyTO> load() {
            return formTO.getProperties();
        }
    };

    final ListView<WorkflowFormPropertyTO> propView = new AltListView<WorkflowFormPropertyTO>("propView",
            formProps) {

        private static final long serialVersionUID = 9101744072914090143L;

        @Override
        @SuppressWarnings({ "unchecked", "rawtypes" })
        protected void populateItem(final ListItem<WorkflowFormPropertyTO> item) {
            final WorkflowFormPropertyTO prop = item.getModelObject();

            Label label = new Label("key", prop.getName() == null ? prop.getId() : prop.getName());
            item.add(label);

            FieldPanel field;
            switch (prop.getType()) {
            case Boolean:
                field = new AjaxDropDownChoicePanel("value", label.getDefaultModelObjectAsString(),
                        new Model<Boolean>(Boolean.valueOf(prop.getValue())))
                                .setChoices(Arrays.asList(new String[] { "Yes", "No" }));
                break;

            case Date:
                SimpleDateFormat df = StringUtils.isNotBlank(prop.getDatePattern())
                        ? new SimpleDateFormat(prop.getDatePattern())
                        : new SimpleDateFormat();
                Date parsedDate = null;
                if (StringUtils.isNotBlank(prop.getValue())) {
                    try {
                        parsedDate = df.parse(prop.getValue());
                    } catch (ParseException e) {
                        LOG.error("Unparsable date: {}", prop.getValue(), e);
                    }
                }

                field = new DateTimeFieldPanel("value", label.getDefaultModelObjectAsString(),
                        new Model<Date>(parsedDate), df.toLocalizedPattern());
                break;

            case Enum:
                MapChoiceRenderer<String, String> enumCR = new MapChoiceRenderer<String, String>(
                        prop.getEnumValues());

                field = new AjaxDropDownChoicePanel("value", label.getDefaultModelObjectAsString(),
                        new Model(prop.getValue())).setChoiceRenderer(enumCR).setChoices(new Model() {

                            private static final long serialVersionUID = -858521070366432018L;

                            @Override
                            public Serializable getObject() {
                                return new ArrayList<String>(prop.getEnumValues().keySet());
                            }
                        });
                break;

            case Long:
                field = new SpinnerFieldPanel<Long>("value", label.getDefaultModelObjectAsString(), Long.class,
                        new Model<Long>(NumberUtils.toLong(prop.getValue())), null, null);
                break;

            case String:
            default:
                field = new AjaxTextFieldPanel("value", PARENT_PATH, new Model<String>(prop.getValue()));
                break;
            }

            field.setReadOnly(!prop.isWritable());
            if (prop.isRequired()) {
                field.addRequiredLabel();
            }

            item.add(field);
        }
    };

    final AjaxButton userDetails = new IndicatingAjaxButton("userDetails",
            new Model<String>(getString("userDetails"))) {

        private static final long serialVersionUID = -4804368561204623354L;

        @Override
        protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
            editUserWin.setPageCreator(new ModalWindow.PageCreator() {

                private static final long serialVersionUID = -7834632442532690940L;

                @Override
                public Page createPage() {
                    return new ViewUserModalPage(ApprovalModalPage.this.getPageReference(), editUserWin,
                            userRestClient.read(formTO.getUserKey())) {

                        private static final long serialVersionUID = -2819994749866481607L;

                        @Override
                        protected void closeAction(final AjaxRequestTarget target, final Form form) {
                            setResponsePage(ApprovalModalPage.this);
                        }
                    };
                }
            });

            editUserWin.show(target);
        }
    };
    MetaDataRoleAuthorizationStrategy.authorize(userDetails, ENABLE,
            xmlRolesReader.getEntitlement("Users", "read"));

    final AjaxButton submit = new IndicatingAjaxButton(APPLY, new Model<String>(getString(SUBMIT))) {

        private static final long serialVersionUID = -958724007591692537L;

        @Override
        protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {

            Map<String, WorkflowFormPropertyTO> props = formTO.getPropertyMap();

            for (int i = 0; i < propView.size(); i++) {
                @SuppressWarnings("unchecked")
                ListItem<WorkflowFormPropertyTO> item = (ListItem<WorkflowFormPropertyTO>) propView.get(i);
                String input = ((FieldPanel) item.get("value")).getField().getInput();

                if (!props.containsKey(item.getModelObject().getId())) {
                    props.put(item.getModelObject().getId(), new WorkflowFormPropertyTO());
                }

                if (item.getModelObject().isWritable()) {
                    switch (item.getModelObject().getType()) {
                    case Boolean:
                        props.get(item.getModelObject().getId()).setValue(String.valueOf("0".equals(input)));
                        break;

                    case Date:
                    case Enum:
                    case String:
                    case Long:
                    default:
                        props.get(item.getModelObject().getId()).setValue(input);
                        break;
                    }
                }
            }

            formTO.getProperties().clear();
            formTO.getProperties().addAll(props.values());
            try {
                restClient.submitForm(formTO);

                ((Todo) pageRef.getPage()).setModalResult(true);
                window.close(target);
            } catch (SyncopeClientException e) {
                error(getString(Constants.ERROR) + ": " + e.getMessage());
                LOG.error("While submitting form {}", formTO, e);
                feedbackPanel.refresh(target);
            }
        }

        @Override
        protected void onError(final AjaxRequestTarget target, final Form<?> form) {
            feedbackPanel.refresh(target);
        }
    };

    final AjaxButton cancel = new IndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL)) {

        private static final long serialVersionUID = -958724007591692537L;

        @Override
        protected void onSubmit(final AjaxRequestTarget target, final Form form) {
            window.close(target);
        }

        @Override
        protected void onError(final AjaxRequestTarget target, final Form form) {
            // nothing
        }
    };

    cancel.setDefaultFormProcessing(false);

    Form form = new Form(FORM);
    form.add(propView);
    form.add(userDetails);
    form.add(submit);
    form.add(cancel);

    MetaDataRoleAuthorizationStrategy.authorize(form, ENABLE,
            xmlRolesReader.getEntitlement("Approval", SUBMIT));

    editUserWin = new ModalWindow("editUserWin");
    editUserWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    editUserWin.setInitialHeight(USER_WIN_HEIGHT);
    editUserWin.setInitialWidth(USER_WIN_WIDTH);
    editUserWin.setCookieName("edit-user-modal");
    add(editUserWin);

    add(form);
}

From source file:org.apache.syncope.client.console.panels.AbstractSearchPanel.java

public String buildFIQL() {
    LOG.debug("Generating FIQL from List<SearchClause>: {}", searchClauses);

    if (searchClauses.isEmpty() || searchClauses.get(0).getType() == null) {
        return StringUtils.EMPTY;
    }//from ww w.ja  v  a2s  .c  o  m

    AbstractFiqlSearchConditionBuilder builder = getSearchConditionBuilder();

    CompleteCondition prevCondition;
    CompleteCondition condition = null;
    for (int i = 0; i < searchClauses.size(); i++) {
        prevCondition = condition;

        switch (searchClauses.get(i).getType()) {
        case ENTITLEMENT:
            condition = searchClauses.get(i).getComparator() == SearchClause.Comparator.EQUALS
                    ? ((GroupFiqlSearchConditionBuilder) builder)
                            .hasEntitlements(searchClauses.get(i).getProperty())
                    : ((GroupFiqlSearchConditionBuilder) builder)
                            .hasNotEntitlements(searchClauses.get(i).getProperty());
            break;

        case MEMBERSHIP:
            Long groupId = NumberUtils.toLong(searchClauses.get(i).getProperty().split(" ")[0]);
            condition = searchClauses.get(i).getComparator() == SearchClause.Comparator.EQUALS
                    ? ((UserFiqlSearchConditionBuilder) builder).inGroups(groupId)
                    : ((UserFiqlSearchConditionBuilder) builder).notInGroups(groupId);
            break;

        case RESOURCE:
            condition = searchClauses.get(i).getComparator() == SearchClause.Comparator.EQUALS
                    ? builder.hasResources(searchClauses.get(i).getProperty())
                    : builder.hasNotResources(searchClauses.get(i).getProperty());
            break;

        case ATTRIBUTE:
            SyncopeProperty property = builder.is(searchClauses.get(i).getProperty());
            switch (searchClauses.get(i).getComparator()) {
            case IS_NULL:
                condition = builder.isNull(searchClauses.get(i).getProperty());
                break;

            case IS_NOT_NULL:
                condition = builder.isNotNull(searchClauses.get(i).getProperty());
                break;

            case LESS_THAN:
                condition = StringUtils.isNumeric(searchClauses.get(i).getProperty())
                        ? property.lessThan(NumberUtils.toDouble(searchClauses.get(i).getValue()))
                        : property.lexicalBefore(searchClauses.get(i).getValue());
                break;

            case LESS_OR_EQUALS:
                condition = StringUtils.isNumeric(searchClauses.get(i).getProperty())
                        ? property.lessOrEqualTo(NumberUtils.toDouble(searchClauses.get(i).getValue()))
                        : property.lexicalNotAfter(searchClauses.get(i).getValue());
                break;

            case GREATER_THAN:
                condition = StringUtils.isNumeric(searchClauses.get(i).getProperty())
                        ? property.greaterThan(NumberUtils.toDouble(searchClauses.get(i).getValue()))
                        : property.lexicalAfter(searchClauses.get(i).getValue());
                break;

            case GREATER_OR_EQUALS:
                condition = StringUtils.isNumeric(searchClauses.get(i).getProperty())
                        ? property.greaterOrEqualTo(NumberUtils.toDouble(searchClauses.get(i).getValue()))
                        : property.lexicalNotBefore(searchClauses.get(i).getValue());
                break;

            case NOT_EQUALS:
                condition = property.notEqualTo(searchClauses.get(i).getValue());
                break;

            case EQUALS:
            default:
                condition = property.equalTo(searchClauses.get(i).getValue());
                break;
            }
        default:
            break;
        }

        if (i > 0) {
            if (searchClauses.get(i).getOperator() == SearchClause.Operator.AND) {
                condition = builder.and(prevCondition, condition);
            }
            if (searchClauses.get(i).getOperator() == SearchClause.Operator.OR) {
                condition = builder.or(prevCondition, condition);
            }
        }
    }

    String fiql = condition == null ? StringUtils.EMPTY : condition.query();
    LOG.debug("Generated FIQL: {}", fiql);
    return fiql;
}