java标签
发表于|更新于
|浏览量:
重要的不是知识的数量,而是知识的质量。有些人知道的很多很多,但却不知道最有用的东西——列夫·托尔斯泰
多层for循环中如果想要跳出循环,可以使用标签:
1 | List<Integer> list = asList(0, 1, 2); |
执行结果

相关推荐
2023-02-25
mapstruct-plus
让礼一寸,得礼一尺——曹操 分享一个框架mapstruct-plus: 官网:https://mapstruct.plus/ 可以很方便使用mapstruct
2021-06-12
parallelStream
我又愿中国青年只是向上走,不必理会这冷笑和暗箭。——鲁迅 我们在开发中经常使用stream去处理我们的集合 这里分享一个并行流:parallelStream 它可以允许我们的声明式编程以多线程并行的方式执行 首先我们可以比较一下性能 1234567891011121314List<Integer> list = new SecureRandom().ints().limit(10000000).boxed().collect(Collectors.toList());long startTime = System.nanoTime();// 求和操作int sum = list.stream().mapToInt(Integer::intValue).reduce(0, Integer::sum);System.out.println("普通stream求和结果:" + sum);long normalStreamEndTime = System.nanoTime();System.out.println("普通stream耗时:&q...
2021-04-08
mp数据源加密
不宝金玉,而忠信以为宝。——《礼记》 在开发中,我们难免可能会担心数据库账号密码泄露 我们可以使用mybatis-plus自带的数据安全保护进行加密 123456789101112public static void main(String[] args) throws Throwable { // 生成 16 位随机 AES 密钥 String randomKey = AES.generateRandomKey(); // 随机密钥加密 String url = AES.encrypt("jdbc:mysql://localhost:3306/ruben?autoReconnect=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useUnicode=true&characterEncoding=utf-8&useSSL=false&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&...
2022-12-12
开源ocr库tesseract
强者容易坚强,正如弱者容易软弱。——爱默生 分享一个开源的OCR库 文档链接:https://tesseract-ocr.github.io/ 源码地址:https://github.com/tesseract-ocr/tesseract 其包含了多种编程语言
2024-09-09
Apache-ShenYu支持namespace功能(四)
教育的最高目标不是知识而是行动。——斯宾塞 本次适配是将几个页面的namespace选择框隐藏了,然后对data-permission数据权限配置弹框里添加了一个namespace选择框,并在内部切换namespace时候刷新表格 PR链接: https://github.com/apache/shenyu-dashboard/pull/479 隐藏namespace的逻辑很简单,首先用withRouter将react组件和dvajs的路由绑定: 1import { withRouter } from "dva/router"; 然后绑定: 1export default withRouter(GlobalHeader); 然后从props里取出当前路由 1const { location: { pathname } } = this.props; 进行判断,当不在下列路由里时,showNamespaces为true 12345678const showNamespaces = !~[ ...
2021-08-12
ActiveRecord
理想主义者是不可救药的:如果他被扔出了他的天堂,他会再制造出一个理想的地狱。——尼采 MybatisPlus支持ActiveRecord形式调用,实体类只需继承Model类即可进行强大的CRUD操作 效果如下: 12345678910111213141516171819202122232425262728293031323334import com.baomidou.mybatisplus.extension.activerecord.Model;import lombok.Data;import lombok.EqualsAndHashCode;import java.io.Serializable;@Data@Builder@ToString@Accessors@NoArgsConstructor@AllArgsConstructor@EqualsAndHashCode(callSuper = true)public class UserDetail extends Model<UserDetail> implements Serializable {...
