當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。