上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页
摘要: 一、方法概述 limit 方法可以对流中数据进行截取 Stream<T> limit(long maxSize) 该方法接收一个 long 类型参数,代表截取最大值,如果 maxSize 大于流中元素总数,则实际截取的是流中所有元素 二、案例 public class StreamDemo { pu 阅读全文
posted @ 2022-07-12 19:37 变体精灵 阅读(1158) 评论(0) 推荐(0) 编辑
摘要: 一、方法概述 filter 方法用于过滤流中数据,返回符合条件的数据结果 Stream<T> filter(Predicate<? super T> predicate); boolean test(T t); 该方法接收一个 Predicate 接口函数,该函数中有一个抽象方法 test(),返回 阅读全文
posted @ 2022-07-12 19:21 变体精灵 阅读(7268) 评论(0) 推荐(0) 编辑
摘要: 一、方法概述 Stream 流提供 count 方法来统计其中的元素个数 二、案例 @Slf4j public class StreamDemo { public static void main(String[] args) { List<Person> personList = Arrays.a 阅读全文
posted @ 2022-07-12 19:03 变体精灵 阅读(1257) 评论(0) 推荐(0) 编辑
摘要: 一、方法概述 void forEach(Consumer<? super T> action) 该方法接收一个 Consumer 接口函数,会将每一个流元素交给该函数进行处理 二、案例 public class StreamDemo { public static void main(String[ 阅读全文
posted @ 2022-07-11 21:27 变体精灵 阅读(883) 评论(0) 推荐(0) 编辑
摘要: 一、简介 如果一个接口中只有一个方法,那么该接口就称为函数型接口,对于函数型接口,我们会加上注解 @FunctionalInterface 进行校验,如果某一个接口中存在两个抽象方法,那么它就会报错. 例如 JDK 8 内置的四大函数型接口之一 Function @FunctionalInterfa 阅读全文
posted @ 2022-07-08 18:25 变体精灵 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 一、代码 public class UnitTest { // 金额字符串格式化为千分符 public static String fmtMicrometer(String amount) { DecimalFormat df = null; if (amount.indexOf(".") > 0) 阅读全文
posted @ 2022-07-04 20:39 变体精灵 阅读(144) 评论(0) 推荐(0) 编辑
摘要: <select id="listAgentWithdrawApplyOrder" resultType="org.channel.entity.agent.AgentWithDrawApplyOrderDto"> select * from t_agent_withdraw_apply_order 阅读全文
posted @ 2022-06-27 10:30 变体精灵 阅读(29) 评论(0) 推荐(0) 编辑
摘要: char 和 varchar 类型相似,都是用来存储字符串,但是它们 存储 和 检索 的方式不同,char 属于固定长度的字符类型,而 varchar 属于长度可变的字符类型 一、准备数据 创建一张 test 表,建表语句如下 CREATE TABLE `test` ( `id` int NOT N 阅读全文
posted @ 2022-05-14 17:23 变体精灵 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 一、数据准备 创建 employee 表 CREATE TABLE `employee` ( `id` int NOT NULL AUTO_INCREMENT COMMENT '主键 id', `name` varchar(32) NOT NULL DEFAULT '' COMMENT '姓名', 阅读全文
posted @ 2022-05-13 23:06 变体精灵 阅读(1127) 评论(1) 推荐(1) 编辑
摘要: 假设存在如下表 employee employee 表中索引如下 存在主键索引 id,普通索引 idx_name,联合索引 idx_name_age_gender 当通过 name 字段进行查询时,使用 explain 关键字查看 SQL 执行计划 possible_key 中告诉我们可选的索引有 阅读全文
posted @ 2022-05-03 20:37 变体精灵 阅读(51) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 27 下一页
点击右上角即可分享
微信分享提示