本文整理了Java中org.apache.commons.lang.BooleanUtils.isNotTrue()
方法的一些代码示例,展示了BooleanUtils.isNotTrue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BooleanUtils.isNotTrue()
方法的具体详情如下:
包路径:org.apache.commons.lang.BooleanUtils
类名称:BooleanUtils
方法名:isNotTrue
[英]Checks if a Boolean
value is nottrue
, handling null
by returning true
.
BooleanUtils.isNotTrue(Boolean.TRUE) = false
BooleanUtils.isNotTrue(Boolean.FALSE) = true
BooleanUtils.isNotTrue(null) = true
[中]检查Boolean
值是否不是true
,通过返回true
处理null
。
BooleanUtils.isNotTrue(Boolean.TRUE) = false
BooleanUtils.isNotTrue(Boolean.FALSE) = true
BooleanUtils.isNotTrue(null) = true
代码示例来源:origin: docker-java/docker-java
/**
* ValidDeviceMode checks if the mode for device is valid or not.
* Valid mode is a composition of r (read), w (write), and m (mknod).
*
* @link https://github.com/docker/docker/blob/6b4a46f28266031ce1a1315f17fb69113a06efe1/runconfig/opts/parse.go#L796
*/
private static boolean validDeviceMode(String deviceMode) {
Map<String, Boolean> validModes = new HashMap<>(3);
validModes.put("r", true);
validModes.put("w", true);
validModes.put("m", true);
if (isEmpty(deviceMode)) {
return false;
}
for (char ch : deviceMode.toCharArray()) {
final String mode = String.valueOf(ch);
if (isNotTrue(validModes.get(mode))) {
return false; // wrong mode
}
validModes.put(mode, false);
}
return true;
}
代码示例来源:origin: apache/storm
.filter(logs -> logs != null && !logs.isEmpty());
if (BooleanUtils.isNotTrue(searchArchived)) {
portsOfLogs = portsOfLogs.map(fl -> Collections.singletonList(first(fl)));
} else {
List<File> filteredLogs = logsForPort(user, portDir);
if (BooleanUtils.isNotTrue(searchArchived)) {
filteredLogs = Collections.singletonList(first(filteredLogs));
fileOffset = 0;
代码示例来源:origin: BroadleafCommerce/BroadleafCommerce
Boolean sessionTimeout = (Boolean) request.getAttribute("sessionTimeout");
if (StringUtils.isEmpty(failureUrl) && BooleanUtils.isNotTrue(sessionTimeout)) {
failureUrl = defaultFailureUrl;
代码示例来源:origin: BroadleafCommerce/BroadleafCommerce
if (p.getMetadata() instanceof BasicFieldMetadata && BooleanUtils.isNotTrue( p.getMetadata().getExcluded())) {
((BasicFieldMetadata) p.getMetadata()).setVisibility(VisibilityEnum.VISIBLE_ALL);
entityFormProperties.add(p);
代码示例来源:origin: com.github.docker-java/docker-java
/**
* ValidDeviceMode checks if the mode for device is valid or not.
* Valid mode is a composition of r (read), w (write), and m (mknod).
*
* @link https://github.com/docker/docker/blob/6b4a46f28266031ce1a1315f17fb69113a06efe1/runconfig/opts/parse.go#L796
*/
private static boolean validDeviceMode(String deviceMode) {
Map<String, Boolean> validModes = new HashMap<>(3);
validModes.put("r", true);
validModes.put("w", true);
validModes.put("m", true);
if (isEmpty(deviceMode)) {
return false;
}
for (char ch : deviceMode.toCharArray()) {
final String mode = String.valueOf(ch);
if (isNotTrue(validModes.get(mode))) {
return false; // wrong mode
}
validModes.put(mode, false);
}
return true;
}
代码示例来源:origin: GluuFederation/oxAuth
@PostConstruct
public void init() {
if (BooleanUtils.isNotTrue(isEnabledOAuthAuditnLogging())) {
return;
}
tryToEstablishJMSConnection();
}
代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-core
public List<DocumentModel> getSelectedConfs(DocumentModel document) throws NuxeoException {
List<DocumentModel> selectedWebConfs = new ArrayList<DocumentModel>(0);
if (document.hasFacet(WebConfsConfigurationConstants.WEB_CONFS_CONFIGURATION_FACET)) {
Boolean allDocsDenied = (Boolean) document.getPropertyValue(WebConfsConfigurationConstants.WEB_CONFS_CONFIGURATION_DENIED_ALL_PROPERTY);
if (BooleanUtils.isNotTrue(allDocsDenied)) {
List<String> allowedWebConfs = getAllowedWebConfs(document);
List<DocumentModel> allglobalWebConfs = getAllGlobalWebConfs(document);
for (String webConfCode : allowedWebConfs) {
boolean found = false;
Iterator<DocumentModel> iterator = allglobalWebConfs.iterator();
while (iterator.hasNext() && !found) {
DocumentModel globalWebConf = iterator.next();
String confCode = (String) globalWebConf.getPropertyValue(ToutaticeNuxeoStudioConst.CST_DOC_XPATH_WEB_CONF_CODE);
if (StringUtils.isNotBlank(confCode) && webConfCode.equals(confCode)) {
selectedWebConfs.add(globalWebConf);
found = true;
}
}
}
}
}
// Collections.sort(selectedTypes, new TypeLabelAlphabeticalOrder(messages));
return selectedWebConfs;
}
代码示例来源:origin: Evolveum/midpoint
if (definition.getDefaultFor() == kind) {
defaultRelationNames.add(relationName);
if (BooleanUtils.isNotTrue(definition.isStaticallyDefined())) {
userDefinedDefaultRelationNames.add(relationName);
代码示例来源:origin: apache/ctakes
/**
* @param loader
* the loader to manage
* @return the sql string
*/
public final String getSqlInsert(final CsvLoadType loader) {
String query = "insert into " + loader.getTable() + " (";
String values = ") values (";
for (Column column : loader.getColumn()) {
if (BooleanUtils.isNotTrue(column.isSkip())) {
query += column.getName() + ",";
values += "?,";
}
}
return StringUtils.removeEnd(query, ",")
+ StringUtils.removeEnd(values, ",") + ")";
}
代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-web
public List<DocumentModel> getNotSelectedConfs(DocumentModel document) throws NuxeoException {
List<DocumentModel> notSelectedWebConfs = new ArrayList<DocumentModel>(0);
if (document.hasFacet(WebConfsConfigurationConstants.WEB_CONFS_CONFIGURATION_FACET)) {
WebConfsConfiguration webConfsConfiguration = document.getAdapter(WebConfsConfiguration.class);
if (webConfsConfiguration != null) {
Boolean allDocsDenied = (Boolean) document.getPropertyValue(WebConfsConfigurationConstants.WEB_CONFS_CONFIGURATION_DENIED_ALL_PROPERTY);
if (BooleanUtils.isNotTrue(allDocsDenied)) {
List<String> allowedWebConfs = getAllowedWebConfs(document);
notSelectedWebConfs = webConfsConfiguration.getAllGlobalWebConfs(document);
for (String webConfCode : allowedWebConfs) {
boolean found = false;
Iterator<DocumentModel> iterator = notSelectedWebConfs.iterator();
while (iterator.hasNext() && !found) {
DocumentModel globalWebConf = iterator.next();
String confCode = (String) globalWebConf.getPropertyValue(ToutaticeNuxeoStudioConst.CST_DOC_XPATH_WEB_CONF_CODE);
if (StringUtils.isNotBlank(confCode) && webConfCode.equals(confCode)) {
iterator.remove();
found = true;
}
}
}
}
}
}
// Collections.sort(selectedTypes, new TypeLabelAlphabeticalOrder(messages));
return notSelectedWebConfs;
}
代码示例来源:origin: GluuFederation/oxAuth
private boolean tryToEstablishJMSConnectionImpl() {
destroy();
Set<String> jmsBrokerURISet = getJmsBrokerURISet();
if (BooleanUtils.isNotTrue(isEnabledOAuthAuditnLogging()) || CollectionUtils.isEmpty(jmsBrokerURISet))
return false;
this.jmsBrokerURISet = new HashSet<String>(jmsBrokerURISet);
this.jmsUserName = getJmsUserName();
this.jmsPassword = getJmsPassword();
Iterator<String> jmsBrokerURIIterator = jmsBrokerURISet.iterator();
StringBuilder uriBuilder = new StringBuilder();
while (jmsBrokerURIIterator.hasNext()) {
String jmsBrokerURI = jmsBrokerURIIterator.next();
uriBuilder.append("tcp://");
uriBuilder.append(jmsBrokerURI);
if (jmsBrokerURIIterator.hasNext())
uriBuilder.append(",");
}
String brokerUrl = BROKER_URL_PREFIX + uriBuilder + BROKER_URL_SUFFIX;
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(this.jmsUserName, this.jmsPassword,
brokerUrl);
this.pooledConnectionFactory = new PooledConnectionFactory(connectionFactory);
pooledConnectionFactory.setIdleTimeout(5000);
pooledConnectionFactory.setMaxConnections(10);
pooledConnectionFactory.start();
return true;
}
代码示例来源:origin: Evolveum/midpoint
private static boolean isIndexed(ItemDefinition definition, QName elementName,
boolean indexAlsoDynamics, PrismContext prismContext)
throws SchemaException {
if (definition instanceof PrismContainerDefinition) {
return false;
}
if (definition instanceof PrismReferenceDefinition) {
return true; // TODO make reference indexing configurable
}
if (!(definition instanceof PrismPropertyDefinition)) {
throw new UnsupportedOperationException("Unknown definition type '"
+ definition + "', can't say if '" + elementName + "' is indexed or not.");
}
PrismPropertyDefinition pDefinition = (PrismPropertyDefinition) definition;
Boolean isIndexed = pDefinition.isIndexed();
if (definition.isDynamic() && !indexAlsoDynamics && BooleanUtils.isNotTrue(isIndexed)) {
return false;
}
if (isIndexed != null) {
if (isIndexed && !isIndexedByDefault(definition, prismContext)) {
throw new SchemaException("Item is marked as indexed (definition " + definition.debugDump()
+ ") but definition type (" + definition.getTypeName() + ") doesn't support indexing");
}
return isIndexed;
}
return isIndexedByDefault(definition, prismContext);
}
代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-core
/**
* To throw creation or update document exception.
*/
@Override
public DocumentTranslationMap write(ExportedDocument xdoc) throws IOException {
DocumentTranslationMap dtm = super.write(xdoc);
Boolean compatibilityImport = Boolean.valueOf(Framework.getProperty("ottc.import.archive.compatibility", "true"));
// Maybe error in creation or update
if(dtm == null){
// (Re-) Check schema definition in case of creation
try {
Path xDocPath = xdoc.getPath();
Path parentPath = xDocPath.removeLastSegments(1);
String name = xDocPath.lastSegment();
DocumentModel docModel = new DocumentModelImpl(parentPath.toString(), name,
xdoc.getType());
super.loadSchemas(xdoc, docModel, xdoc.getDocument());
} catch (NuxeoException ce) {
if(BooleanUtils.isNotTrue(compatibilityImport)){
if(log.isDebugEnabled()){
log.debug(ce.getMessage(), ce);
}
throw new IOException(ce.getMessage(), ce);
}
}
}
return dtm;
}
代码示例来源:origin: GluuFederation/oxAuth
@Asynchronous
public void sendMessage(OAuth2AuditLog oAuth2AuditLog) {
if (BooleanUtils.isNotTrue(isEnabledOAuthAuditnLogging())) {
return;
}
if ((this.pooledConnectionFactory == null) || isJmsConfigChanged()) {
if (tryToEstablishJMSConnection())
loggingThroughJMS(oAuth2AuditLog);
else
loggingThroughFile(oAuth2AuditLog);
} else {
loggingThroughJMS(oAuth2AuditLog);
}
}
代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-core
DocumentEventContext docCtx = (DocumentEventContext) context;
if (BooleanUtils.isNotTrue((Boolean) docCtx.getProperty(BLOCK))) {
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
if (BooleanUtils.isNotTrue(resource.isConfirmation())) {
errors.rejectValue(CONFIRMATION, MessageConstants.MESSAGE_NO_CONFIRMATION);
代码示例来源:origin: Evolveum/midpoint
@Override
public WorkItemResultType extractWorkItemResult(Map<String, Object> variables) {
Boolean wasCompleted = ActivitiUtil.getVariable(variables, VARIABLE_WORK_ITEM_WAS_COMPLETED, Boolean.class, prismContext);
if (BooleanUtils.isNotTrue(wasCompleted)) {
return null;
}
WorkItemResultType result = new WorkItemResultType(prismContext);
result.setOutcome(ActivitiUtil.getVariable(variables, FORM_FIELD_OUTCOME, String.class, prismContext));
result.setComment(ActivitiUtil.getVariable(variables, FORM_FIELD_COMMENT, String.class, prismContext));
String additionalDeltaString = ActivitiUtil.getVariable(variables, FORM_FIELD_ADDITIONAL_DELTA, String.class, prismContext);
boolean isApproved = ApprovalUtils.isApproved(result);
if (isApproved && StringUtils.isNotEmpty(additionalDeltaString)) {
try {
ObjectDeltaType additionalDelta = prismContext.parserFor(additionalDeltaString).parseRealValue(ObjectDeltaType.class);
ObjectTreeDeltasType treeDeltas = new ObjectTreeDeltasType();
treeDeltas.setFocusPrimaryDelta(additionalDelta);
result.setAdditionalDeltas(treeDeltas);
} catch (SchemaException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't parse delta received from the activiti form:\n{}", e, additionalDeltaString);
throw new SystemException("Couldn't parse delta received from the activiti form: " + e.getMessage(), e);
}
}
return result;
}
代码示例来源:origin: opentoutatice-ecm.platform/opentoutatice-ecm-platform-automation
if (BooleanUtils.isNotTrue(moderated)) {
FollowTransitionUnrestricted transition = new FollowTransitionUnrestricted(session, comment.getRef(), CommentsConstants
.TRANSITION_TO_PUBLISHED_STATE);
内容来源于网络,如有侵权,请联系作者删除!