当前位置: 首页>>代码示例>>Java>>正文


Java BooleanUtils.toBoolean方法代码示例

本文整理汇总了Java中org.apache.commons.lang.BooleanUtils.toBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java BooleanUtils.toBoolean方法的具体用法?Java BooleanUtils.toBoolean怎么用?Java BooleanUtils.toBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.lang.BooleanUtils的用法示例。


在下文中一共展示了BooleanUtils.toBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupDatabase

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
/**
 * Drop and recreates the databaseName from the template files.
 *
 * @param skipDatabaseCreation
 *            If set to true, the databaseName creation will be skipped (Default: false).
 *
 * @throws Exception
 *             Exception.
 */
@Parameters({ "skipDatabaseCreation" })
@BeforeClass(dependsOnMethods = { "setupIntegrationTest" }, groups = GROUP_INTEGRATION_TEST_SETUP)
public void setupDatabase(@Optional("false") String skipDatabaseCreation) throws Exception {
    if (BooleanUtils.toBoolean(skipDatabaseCreation)) {
        return;
    }
    LOGGER.info("Using the following JDBC URL for the test database: " + jdbcURL);
    try {
        DatabaseUtils.recreateDatabase(jdbcTempURL, suUsername, suPassword, databaseName,
                databaseType, username);
        initializeDatabaseSchemaAndContent();
    } catch (Exception e) {
        LOGGER.error(e.getMessage(), e);
        throw e;
    }
}
 
开发者ID:Communote,项目名称:communote-server,代码行数:26,代码来源:CommunoteIntegrationTest.java

示例2: isStandAlone

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
public static final Boolean isStandAlone() {
  if (standAlone == null) {
    String standAloneValue = configure.get("filecloud.stand-alone");
    if (StringUtils.isNotBlank(standAloneValue)) {
      standAlone = BooleanUtils.toBoolean(standAloneValue.trim());
    } else {
      standAlone = false;
    }
  }
  return standAlone;
}
 
开发者ID:devpage,项目名称:fastdfs-quickstart,代码行数:12,代码来源:Constants.java

示例3: limitSuffix

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
public static Boolean limitSuffix() {
  if (limitSuffix == null) {
    String limitSuffixValue = configure.get("filecloud.limit-file-suffix");
    if (StringUtils.isNotBlank(limitSuffixValue) && BooleanUtils.toBoolean(limitSuffixValue) == true) {
      limitSuffix = true;
    } else {
      limitSuffix = false;
    }
  }
  return limitSuffix;
}
 
开发者ID:devpage,项目名称:fastdfs-quickstart,代码行数:12,代码来源:Constants.java

示例4: canUse

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
public boolean canUse() {
    boolean result = BooleanUtils.toBoolean(SystemConfig.getValue(Constants.KEY_GOOGLE_VISION_USE));
    if (!result) {
        log.warn("画像抽出機能は利用できません。設定を確認してください");
    }
    return result;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:9,代码来源:ImageTextDetectionServiceImpl.java

示例5: createMenuHeader

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
private void createMenuHeader() {
    HorizontalLayout header = new HorizontalLayout();
    header.setSpacing(true);
    header.setWidth("100%");

    Label label = new Label(messages.getMessage(getClass(), "LeftPanel.caption"));
    label.setStyleName("cuba-folders-pane-caption");
    header.addComponent(label);
    header.setExpandRatio(label, 1);

    // NOTE: For development convenience only
    if (BooleanUtils.toBoolean(AppContext.getProperty("sampler.developerMode"))) {
        Button refresh = createButton("Refresh", event -> resetAllMenuItems());
        refresh.setDescription("Reload all menu items");
        header.addComponent(refresh);
        header.setComponentAlignment(refresh, MIDDLE_RIGHT);
    }

    Button collapseAll = createButton("LeftPanel.collapseAll", event -> collapseAll());
    header.addComponent(collapseAll);
    header.setComponentAlignment(collapseAll, MIDDLE_RIGHT);

    Button expandAll = createButton("LeftPanel.expandAll", event -> expandAll());
    header.addComponent(expandAll);
    header.setComponentAlignment(expandAll, MIDDLE_RIGHT);

    menuLayout.addComponent(header);
}
 
开发者ID:cuba-platform,项目名称:sampler,代码行数:29,代码来源:SamplerFoldersPane.java

示例6: init

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
public void init(Map<String, Object> params) {
    super.init(params);

    platformLogoImage.setSource("platform-logo.png");
    platformLogoImage.setWidth("350px");
    platformLogoImage.setHeight("60px");

    initUserIndicator();

    if (BooleanUtils.toBoolean(AppContext.getProperty("sampler.developerMode"))) {
        logoutButton.setVisible(true);
    }
}
 
开发者ID:cuba-platform,项目名称:sampler,代码行数:15,代码来源:SamplerMainWindow.java

示例7: routeTopLevelWindowId

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
protected String routeTopLevelWindowId() {
    if (BooleanUtils.toBoolean(AppContext.getProperty("sampler.developerMode"))) {
        return super.routeTopLevelWindowId();
    }
    return "mainWindow";
}
 
开发者ID:cuba-platform,项目名称:sampler,代码行数:8,代码来源:App.java

示例8: executeTemplateQueryAndRetrieveBoolean

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
/**
 * Given a template name and a sql query, it executes the sql query with the template name; the
 * query returns the number of rows for the given query; if the number of rows is
 * equals to zero (0) it returns false, if it is equals to one (1) it returns true; in case of
 * more rows than one (1) it throws the {@link CloudRuntimeException}.
 */
protected boolean executeTemplateQueryAndRetrieveBoolean(String templateName, String sql) {
    Integer numberOfRegister = getJdbcTemplate().queryForObject(sql, new Object[] {templateName}, Integer.class);
    if (numberOfRegister > 1) {
        throw new CloudRuntimeException(String.format("More than one template with name [%s]", templateName));
    }
    return BooleanUtils.toBoolean(numberOfRegister);
}
 
开发者ID:Autonomiccs,项目名称:autonomiccs-platform,代码行数:14,代码来源:AutonomiccsSystemVmTemplateJdbcDao.java

示例9: DynamicAttributesCondition

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
public DynamicAttributesCondition(Element element, String messagesPack, String filterComponentName, Datasource datasource) {
    super(element, messagesPack, filterComponentName, datasource);

    propertyPath = element.attributeValue("propertyPath");

    MessageTools messageTools = AppBeans.get(MessageTools.NAME);
    locCaption = isBlank(caption)
            ? element.attributeValue("locCaption")
            : messageTools.loadString(messagesPack, caption);

    entityAlias = element.attributeValue("entityAlias");
    text = element.getText();
    join = element.attributeValue("join");
    categoryId = UUID.fromString(element.attributeValue("category"));
    String categoryAttributeValue = element.attributeValue("categoryAttribute");
    if (!Strings.isNullOrEmpty(categoryAttributeValue)) {
        categoryAttributeId = UUID.fromString(categoryAttributeValue);
    } else {
        //for backward compatibility
        List<Element> paramElements = Dom4j.elements(element, "param");
        for (Element paramElement : paramElements) {
            if (BooleanUtils.toBoolean(paramElement.attributeValue("hidden", "false"), "true", "false")) {
                categoryAttributeId = UUID.fromString(paramElement.getText());
                String paramName = paramElement.attributeValue("name");
                text = text.replace(":" + paramName, "'" + categoryAttributeId + "'");
            }
        }
    }

    isCollection = Boolean.parseBoolean(element.attributeValue("isCollection"));
    resolveParam(element);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:33,代码来源:DynamicAttributesCondition.java

示例10: isSkipPaging

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
public static boolean isSkipPaging( Boolean skipPaging, Boolean paging )
{
    if ( skipPaging != null )
    {
        return BooleanUtils.toBoolean( skipPaging );
    }
    else if ( paging != null )
    {
        return !BooleanUtils.toBoolean( paging );
    }
 
    return false;
}
 
开发者ID:dhis2,项目名称:dhis2-core,代码行数:14,代码来源:PagerUtils.java

示例11: isDryRunSuccessful

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
public boolean isDryRunSuccessful() {
	return BooleanUtils.toBoolean(scriptContent.getDryRunSuccessful());
}
 
开发者ID:Cognifide,项目名称:APM,代码行数:5,代码来源:ScriptImpl.java

示例12: valueOf

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
public static boolean valueOf(final Boolean value) {
    return BooleanUtils.toBoolean(value);
}
 
开发者ID:mateli,项目名称:OpenCyclos,代码行数:4,代码来源:ObjectHelper.java

示例13: isPublishRun

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
public boolean isPublishRun() {
	return BooleanUtils.toBoolean(scriptContent.getPublishRun());
}
 
开发者ID:Cognifide,项目名称:APM,代码行数:5,代码来源:ScriptImpl.java

示例14: resolveParam

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
protected void resolveParam(Element element) {
    Scripting scripting = AppBeans.get(Scripting.NAME);
    String aclass = element.attributeValue("class");
    if (!isBlank(aclass)) {
        javaClass = scripting.loadClass(aclass);
    }

    String operatorName = element.attributeValue("operatorType", null);
    if (operatorName != null) {
        operator = Op.valueOf(operatorName);
    }

    List<Element> paramElements = Dom4j.elements(element, "param");
    if (!paramElements.isEmpty()) {
        Element paramElem = paramElements.iterator().next();

        if (BooleanUtils.toBoolean(paramElem.attributeValue("hidden", "false"), "true", "false")) {
            paramElem = paramElements.iterator().next();
        }
        paramName = paramElem.attributeValue("name");

        if (!isBlank(paramElem.attributeValue("javaClass"))) {
            paramClass = scripting.loadClass(paramElem.attributeValue("javaClass"));
        }

        ConditionParamBuilder paramBuilder = AppBeans.get(ConditionParamBuilder.class);
        if (Strings.isNullOrEmpty(paramName)) {
            paramName = paramBuilder.createParamName(this);
        }

        param = paramBuilder.createParam(this);
        param.setDateInterval(BooleanUtils.toBoolean(paramElem.attributeValue("isDateInterval", "false"), "true", "false"));
        param.parseValue(paramElem.getText());
        param.setDefaultValue(param.getValue());
    }

    if ("EMPTY".equals(operatorName)) {
        //for backward compatibility with old filters that still use EMPTY operator
        operatorName = "NOT_EMPTY";
        if (BooleanUtils.isTrue((Boolean) param.getValue()))
            param.setValue(false);
        param.setDefaultValue(false);
        operator = Op.valueOf(operatorName);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:46,代码来源:AbstractCondition.java

示例15: setPrintInnerJoinOnClause

import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
private void setPrintInnerJoinOnClause(Session session) {
    boolean useInnerJoinOnClause = BooleanUtils.toBoolean(
            AppContext.getProperty("cuba.useInnerJoinOnClause"));
    session.getPlatform().setPrintInnerJoinInWhereClause(!useInnerJoinOnClause);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:6,代码来源:EclipseLinkSessionEventListener.java


注:本文中的org.apache.commons.lang.BooleanUtils.toBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。