本文整理汇总了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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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";
}
示例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);
}
示例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);
}
示例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;
}
示例11: isDryRunSuccessful
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
public boolean isDryRunSuccessful() {
return BooleanUtils.toBoolean(scriptContent.getDryRunSuccessful());
}
示例12: valueOf
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
public static boolean valueOf(final Boolean value) {
return BooleanUtils.toBoolean(value);
}
示例13: isPublishRun
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
public boolean isPublishRun() {
return BooleanUtils.toBoolean(scriptContent.getPublishRun());
}
示例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);
}
}
示例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);
}