cn.hutool.core.util.BooleanUtil Java Examples
The following examples show how to use
cn.hutool.core.util.BooleanUtil.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractS3BaseFileService.java From zfile with MIT License | 6 votes |
/** * 获取对象的访问链接, 如果指定了域名, 则替换为自定义域名. * @return S3 对象访问地址 */ public String s3ObjectUrl(String path) { basePath = basePath == null ? "" : basePath; String fullPath = StringUtils.removeFirstSeparator(StringUtils.removeDuplicateSeparator(basePath + ZFileConstant.PATH_SEPARATOR + path)); // 如果不是私有空间, 且指定了加速域名, 则直接返回下载地址. if (BooleanUtil.isFalse(isPrivate) && StringUtils.isNotNullOrEmpty(domain)) { return StringUtils.concatPath(domain, fullPath); } Date expirationDate = new Date(System.currentTimeMillis() + timeout * 1000); URL url = s3Client.generatePresignedUrl(bucketName, fullPath, expirationDate); String defaultUrl = url.toExternalForm(); if (StringUtils.isNotNullOrEmpty(domain)) { defaultUrl = URLUtil.complateUrl(domain, url.getFile()); } return URLUtil.decode(defaultUrl); }
Example #2
Source File: BaseForm.java From datax-web with MIT License | 5 votes |
/** * 解析出mybatis plus分页查询参数 */ public Page getPlusPagingQueryEntity() { Page page = new Page(); //如果无current,默认返回1000条数据 page.setCurrent(this.getPageNo()); page.setSize(this.getPageSize()); if (ObjectUtil.isNotNull(this.get("ifCount"))) { page.setSearchCount(BooleanUtil.toBoolean(this.getString("ifCount"))); } else { //默认给true page.setSearchCount(true); } return page; }
Example #3
Source File: SearchBuilder.java From microservices-platform with Apache License 2.0 | 5 votes |
/** * 设置是否需要高亮处理 * @param isHighlighter 是否需要高亮处理 */ public SearchBuilder setIsHighlight(Boolean isHighlighter) { if (BooleanUtil.isTrue(isHighlighter)) { this.setHighlight("*" , HIGHLIGHTER_PRE_TAGS, HIGHLIGHTER_POST_TAGS); } return this; }
Example #4
Source File: DataMigrationUtils.java From v-mock with MIT License | 5 votes |
/** * 数据迁移操作 */ @SneakyThrows public static void dataMigrationCheck() { // 检查是否需要数据迁移 String isNeedDataMigration = System.getProperty("dm"); // -Ddm参数传了【true, yes, y, t, ok, 1, on, 是, 对, 真】 都行 if (!BooleanUtil.toBoolean(isNeedDataMigration)) { log.info("Without data migration. "); return; } // 获取历史版本的数据文件 List<File> historyDataFileList = getHistoryDataFileList(); // check empty if (CollUtil.isEmpty(historyDataFileList)) { log.info("No history database file found. Run application.."); return; } // 选出旧版本的数据库文件 File targetOldDbFile = getTargetFile(historyDataFileList); log.info("Find old version db file {}. start migration...", targetOldDbFile.getName()); // 获取当前ClassLoader ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); // DB文件URL URL currentDbFileUrl = classLoader.getResource(DB_FILE_PATH); // 以 link org.sqlite.SQLiteConnection 源码中的命名方式迁移DB文件 String dbFileName = String.format("sqlite-jdbc-tmp-%d.db", currentDbFileUrl.hashCode()); String tempFolder = new File(System.getProperty("java.io.tmpdir")).getAbsolutePath(); File currentDbFile = new File(tempFolder, dbFileName); // 将旧数据库文件复制一份,并用当前数据库命名方式命名以完成数据迁移 File currentDb = FileUtil.copy(targetOldDbFile, currentDbFile, true); log.info("Data file {} migration success", currentDb.getName()); }
Example #5
Source File: BaseWebDrive.java From LuckyFrameClient with GNU Affero General Public License v3.0 | 5 votes |
/** * ���Զ��������м�������ʾЧ�� * @param driver ���� * @param element ��λԪ�� * @author Seagull * @date 2019��9��6�� */ public static void highLightElement(WebDriver driver, WebElement element){ Properties properties = SysConfig.getConfiguration(); boolean highLight = BooleanUtil.toBoolean(properties.getProperty("webdriver.highlight")); if(highLight){ JavascriptExecutor js = (JavascriptExecutor) driver; /*����js�����������ҳ��Ԫ�ض���ı�����ɫ�ͱ߿���ɫ�ֱ��趨Ϊ��ɫ�ͺ�ɫ*/ js.executeScript("arguments[0].setAttribute('style', arguments[1]);", element, "background: yellow; border:2px solid red;"); } }