本文整理汇总了Java中org.apache.commons.lang.BooleanUtils.isTrue方法的典型用法代码示例。如果您正苦于以下问题:Java BooleanUtils.isTrue方法的具体用法?Java BooleanUtils.isTrue怎么用?Java BooleanUtils.isTrue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang.BooleanUtils
的用法示例。
在下文中一共展示了BooleanUtils.isTrue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: diaryEntries
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@CacheControl(policy = CachePolicy.NO_CACHE)
@RequestMapping(method = RequestMethod.GET)
public List<GameDiaryEntryDTO> diaryEntries(
@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) final LocalDate beginDate,
@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) final LocalDate endDate,
@RequestParam(required = false) final Boolean reportedForOthers,
@RequestParam(required = false) final Boolean srvaEvents) {
final Interval interval = beginDate.isAfter(endDate)
? DateUtil.createDateInterval(endDate, beginDate)
: DateUtil.createDateInterval(beginDate, endDate);
final List<GameDiaryEntryDTO> dtos = diaryFeature.listDiaryEntriesForActiveUser(
interval, BooleanUtils.isTrue(reportedForOthers));
if (BooleanUtils.isTrue(srvaEvents)) {
dtos.addAll(srvaCrudFeature.listSrvaEventsForActiveUser(interval));
}
return dtos;
}
示例2: createHierarhicalRow
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
protected int createHierarhicalRow(TreeTable table, List<Table.Column> columns,
Boolean exportExpanded, int rowNumber, Object itemId) {
HierarchicalDatasource hd = table.getDatasource();
createRow(table, columns, 0, ++rowNumber, itemId);
if (BooleanUtils.isTrue(exportExpanded) && !table.isExpanded(itemId) && !hd.getChildren(itemId).isEmpty()) {
return rowNumber;
} else {
final Collection children = hd.getChildren(itemId);
if (children != null && !children.isEmpty()) {
for (Object id : children) {
if (BooleanUtils.isTrue(exportExpanded) && !table.isExpanded(id) && !hd.getChildren(id).isEmpty()) {
createRow(table, columns, 0, ++rowNumber, id);
continue;
}
rowNumber = createHierarhicalRow(table, columns, exportExpanded, rowNumber, id);
}
}
}
return rowNumber;
}
示例3: addNewProposedShadow
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
public String addNewProposedShadow(ProvisioningContext ctx, PrismObject<ShadowType> shadow, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, ExpressionEvaluationException, ObjectAlreadyExistsException, SecurityViolationException {
ResourceConsistencyType consistency = ctx.getResource().getConsistency();
if (consistency == null) {
return null;
}
if (!BooleanUtils.isTrue(consistency.isUseProposedShadows())) {
return null;
}
PrismObject<ShadowType> repoShadow = createRepositoryShadow(ctx, shadow);
repoShadow.asObjectable().setLifecycleState(SchemaConstants.LIFECYCLE_PROPOSED);
addPendingOperationAdd(repoShadow, shadow, task.getTaskIdentifier());
ConstraintsChecker.onShadowAddOperation(repoShadow.asObjectable());
String oid = repositoryService.addObject(repoShadow, null, result);
LOGGER.trace("Draft shadow added to the repository: {}", repoShadow);
return oid;
}
示例4: matchesOrgRelation
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
private <O extends ObjectType> boolean matchesOrgRelation(PrismObject<O> object, ObjectReferenceType subjectParentOrgRef,
OrgRelationObjectSpecificationType specOrgRelation, String autzHumanReadableDesc, String desc) throws SchemaException {
if (!MiscSchemaUtil.compareRelation(specOrgRelation.getSubjectRelation(), subjectParentOrgRef.getRelation())) {
return false;
}
if (BooleanUtils.isTrue(specOrgRelation.isIncludeReferenceOrg()) && subjectParentOrgRef.getOid().equals(object.getOid())) {
return true;
}
if (specOrgRelation.getScope() == null) {
return repositoryService.isDescendant(object, subjectParentOrgRef.getOid());
}
switch (specOrgRelation.getScope()) {
case ALL_DESCENDANTS:
return repositoryService.isDescendant(object, subjectParentOrgRef.getOid());
case DIRECT_DESCENDANTS:
return hasParentOrgRef(object, subjectParentOrgRef.getOid());
case ALL_ANCESTORS:
return repositoryService.isAncestor(object, subjectParentOrgRef.getOid());
default:
throw new UnsupportedOperationException("Unknown orgRelation scope "+specOrgRelation.getScope());
}
}
示例5: registerExecutionFinish
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
protected void registerExecutionFinish(ScheduledTask task, ScheduledExecution execution, Object result) {
if ((!BooleanUtils.isTrue(task.getLogFinish()) && !BooleanUtils.isTrue(task.getSingleton()) && task.getSchedulingType() != SchedulingType.FIXED_DELAY)
|| execution == null)
return;
log.trace("{}: registering execution finish", task);
Transaction tx = persistence.createTransaction();
try {
EntityManager em = persistence.getEntityManager();
execution = em.merge(execution);
execution.setFinishTime(timeSource.currentTimestamp());
if (result != null)
execution.setResult(result.toString());
tx.commit();
} finally {
tx.end();
}
}
示例6: printActiveScheduledTasks
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
public String printActiveScheduledTasks() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
StringBuilder sb = new StringBuilder();
List<ScheduledTask> tasks = scheduling.getActiveTasks();
for (ScheduledTask task : tasks) {
sb.append(task).append(", lastStart=");
if (task.getLastStartTime() != null) {
sb.append(dateFormat.format(task.getLastStartTime()));
if (BooleanUtils.isTrue(task.getSingleton()))
sb.append(" on ").append(task.getLastStartServer());
} else {
sb.append("<never>");
}
sb.append("\n");
}
return sb.toString();
}
示例7: init
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
public void init(Map<String, Object> params) {
@SuppressWarnings("unchecked")
BackgroundTask<T, V> task = (BackgroundTask<T, V>) params.get("task");
String title = (String) params.get("title");
if (title != null) {
setCaption(title);
}
String message = (String) params.get("message");
if (message != null) {
text.setValue(message);
}
Boolean cancelAllowedNullable = (Boolean) params.get("cancelAllowed");
cancelAllowed = BooleanUtils.isTrue(cancelAllowedNullable);
cancelButton.setVisible(cancelAllowed);
getDialogOptions().setCloseable(cancelAllowed);
BackgroundTask<T, V> wrapperTask = new LocalizedTaskWrapper<>(task, this);
taskHandler = backgroundWorker.handle(wrapperTask);
taskHandler.execute();
}
示例8: getServerPriority
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
protected Integer getServerPriority(ScheduledTask task, String serverId) {
String permittedServers = task.getPermittedServers();
if (StringUtils.isBlank(permittedServers)) {
if (BooleanUtils.isTrue(task.getSingleton()) && !clusterManager.isMaster())
return null;
else
return 0;
}
String[] parts = permittedServers.trim().split("[,;]");
for (int i = 0; i < parts.length; i++) {
if (serverId.equals(parts[i].trim())) {
return i + 1;
}
}
return null;
}
示例9: searchEntitiesListGet
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@GetMapping("/{entityName}/search")
public ResponseEntity<String> searchEntitiesListGet(@PathVariable String entityName,
@RequestParam String filter,
@RequestParam(required = false) String view,
@RequestParam(required = false) Integer limit,
@RequestParam(required = false) Integer offset,
@RequestParam(required = false) String sort,
@RequestParam(required = false) Boolean returnNulls,
@RequestParam(required = false) Boolean returnCount,
@RequestParam(required = false) Boolean dynamicAttributes,
@RequestParam(required = false) String modelVersion) {
EntitiesSearchResult entitiesSearchResult = entitiesControllerManager.searchEntities(entityName, filter,
view, limit, offset, sort, returnNulls, returnCount, dynamicAttributes, modelVersion);
ResponseEntity.BodyBuilder responseBuilder = ResponseEntity.status(HttpStatus.OK);
if (BooleanUtils.isTrue(returnCount)) {
responseBuilder.header("X-Total-Count", entitiesSearchResult.getCount().toString());
}
return responseBuilder.body(entitiesSearchResult.getJson());
}
示例10: executeQueryGet
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@GetMapping("/{entityName}/{queryName}")
public ResponseEntity<String> executeQueryGet(@PathVariable String entityName,
@PathVariable String queryName,
@RequestParam(required = false) Integer limit,
@RequestParam(required = false) Integer offset,
@RequestParam(required = false) String view,
@RequestParam(required = false) Boolean returnNulls,
@RequestParam(required = false) Boolean dynamicAttributes,
@RequestParam(required = false) Boolean returnCount,
@RequestParam(required = false) String modelVersion,
@RequestParam Map<String, String> params) {
String resultJson = queriesControllerManager.executeQueryGet(entityName, queryName, limit, offset, view, returnNulls, dynamicAttributes, modelVersion, params);
ResponseEntity.BodyBuilder responseBuilder = ResponseEntity.status(HttpStatus.OK);
if (BooleanUtils.isTrue(returnCount)) {
String count = queriesControllerManager.getCountGet(entityName, queryName, modelVersion, params);
responseBuilder.header("X-Total-Count", count);
}
return responseBuilder.body(resultJson);
}
示例11: loadEntitiesList
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@GetMapping("/{entityName}")
public ResponseEntity<String> loadEntitiesList(@PathVariable String entityName,
@RequestParam(required = false) String view,
@RequestParam(required = false) Integer limit,
@RequestParam(required = false) Integer offset,
@RequestParam(required = false) String sort,
@RequestParam(required = false) Boolean returnNulls,
@RequestParam(required = false) Boolean returnCount,
@RequestParam(required = false) Boolean dynamicAttributes,
@RequestParam(required = false) String modelVersion) {
EntitiesSearchResult entitiesSearchResult = entitiesControllerManager.loadEntitiesList(entityName, view, limit,
offset, sort, returnNulls, returnCount, dynamicAttributes, modelVersion);
ResponseEntity.BodyBuilder responseBuilder = ResponseEntity.status(HttpStatus.OK);
if (BooleanUtils.isTrue(returnCount)) {
responseBuilder.header("X-Total-Count", entitiesSearchResult.getCount().toString());
}
return responseBuilder.body(entitiesSearchResult.getJson());
}
示例12: update
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
public void update(UpdateNote note) throws NoteNotFoundException, AccessingOtherUsersNotesException {
assertNoteExisting(note.getId());
assertCorrectNoteUser(findNoteById(note.getId()).getUserId(), note.getUserId());
if(BooleanUtils.isTrue(note.getArchived())) {
dao.delete(note.getId());
archivedDao.save(mapArchived(note));
} else {
archivedDao.delete(note.getId());
dao.save(map(note));
}
}
示例13: getRef
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
public ReferenceConfig<TestAbcService> getRef(Class<TestAbcService> interfaceClass, RegistryConfig tempRegistry) {
if (BooleanUtils.isTrue(reference.isInit())) {
return reference;
}
reference.setInterface(interfaceClass); // 弱类型接口名
com.alibaba.dubbo.config.RegistryConfig rc = new com.alibaba.dubbo.config.RegistryConfig();
rc.setProtocol(tempRegistry.getRegistryProtocol());
rc.setAddress(tempRegistry.getRegistryAddress());
rc.setTimeout(tempRegistry.getRegistryTimeout());
reference.setRegistry(rc);
reference.setApplication(new ApplicationConfig("test"));
return reference;
}
示例14: hasModalWindow
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
protected boolean hasModalWindow() {
for (Map.Entry<Window, WindowOpenInfo> entry : windowOpenMode.entrySet()) {
if (OpenMode.DIALOG == entry.getValue().getOpenMode()
&& BooleanUtils.isTrue(entry.getKey().getDialogOptions().getModal())) {
return true;
}
}
return false;
}
示例15: updateText
import org.apache.commons.lang.BooleanUtils; //导入方法依赖的package包/类
@Override
protected void updateText() {
if (operator == Op.NOT_EMPTY) {
if (BooleanUtils.isTrue((Boolean) param.getValue())) {
text = text.replace("not exists", "exists");
} else if (BooleanUtils.isFalse((Boolean) param.getValue()) && !text.contains("not exists")) {
text = text.replace("exists ", "not exists ");
}
}
if (!isCollection) {
if (operator == Op.ENDS_WITH || operator == Op.STARTS_WITH || operator == Op.CONTAINS || operator == Op.DOES_NOT_CONTAIN) {
Matcher matcher = LIKE_PATTERN.matcher(text);
if (matcher.find()) {
String escapeCharacter = ("\\".equals(QueryUtils.ESCAPE_CHARACTER) || "$".equals(QueryUtils.ESCAPE_CHARACTER))
? QueryUtils.ESCAPE_CHARACTER + QueryUtils.ESCAPE_CHARACTER
: QueryUtils.ESCAPE_CHARACTER;
text = matcher.replaceAll("$1 ESCAPE '" + escapeCharacter + "' ");
}
}
} else {
if (operator == Op.CONTAINS) {
text = text.replace("not exists", "exists");
} else if (operator == Op.DOES_NOT_CONTAIN && !text.contains("not exists")) {
text = text.replace("exists ", "not exists ");
}
}
}