首页 > 其他分享 >Stream流简单使用

Stream流简单使用

时间:2022-10-17 23:46:10浏览次数:47  
标签:name Stream Author builder 简单 build 使用 id address

创建流

/**
     * 创建流
     */
    @Test
    public void testOne() {
        List<Author> authorList = new ArrayList<>();
        authorList.add(Author.builder().id(1).name("小白").address("浦东大道").build());
        authorList.add(Author.builder().id(2).name("小红").address("星光大道").build());
        //集合创建流
        Stream<Author> stream = authorList.stream();
        log.info("stream:{}", stream);

        Integer[] arr = {1, 2, 3, 4, 5, 6};
        //数组创建流
        Stream<Integer> integerStream = Arrays.stream(arr);
        log.info("integerStream:{}", integerStream);
        //数组创建流
        Stream<Integer> integerStream1 = Stream.of(arr);
        log.info("integerStream1:{}", integerStream1);

        Map<String, Integer> map = new HashMap<>(16);
        map.put("1", 123);
        map.put("2", 234);
        map.put("3", 345);
        map.put("4", 456);
        Set<Map.Entry<String, Integer>> entrySet = map.entrySet();
        //map集合创建流
        Stream<Map.Entry<String, Integer>> entryStream = entrySet.stream();
        log.info("entryStream:{}", entryStream);
    }

  filter过滤使用

List<Author> authorList = new ArrayList<>();
        authorList.add(Author.builder().id(1).name("小白").address("浦东大道").build());
        authorList.add(Author.builder().id(2).name("小红").address("星光大道").build());
        authorList.add(Author.builder().id(3).name("小绿").address("太古里").build());
        authorList.add(Author.builder().id(4).name("小得子").address("三里屯").build());
        //集合创建流
        Stream<Author> stream = authorList.stream();
        //打印id>2的且姓名长度等于3的
        stream.filter(new Predicate<Author>() {
            @Override
            public boolean test(Author author) {
                Integer id = author.getId();
                int length = author.getName().length();
                if (id>2&&length==3){
                    return true;
                }
                return false;
            }
        });

  转化为lamda表达式

List<Author> authorList = new ArrayList<>();
authorList.add(Author.builder().id(1).name("小白").address("浦东大道").build());
authorList.add(Author.builder().id(2).name("小红").address("星光大道").build());
authorList.add(Author.builder().id(3).name("小绿").address("太古里").build());
authorList.add(Author.builder().id(4).name("小得子").address("三里屯").build());
//集合创建流
Stream<Author> stream = authorList.stream();
//打印id>2的且姓名长度等于3的
stream.filter(author -> {
Integer id = author.getId();
int length = author.getName().length();
if (id>2&&length==3){
return true;
}
return false;
}).forEach(new Consumer<Author>() {
@Override
public void accept(Author author) {
log.info(author.toString());
}
});

 继续简化

 List<Author> authorList = new ArrayList<>();
        authorList.add(Author.builder().id(1).name("小白").address("浦东大道").build());
        authorList.add(Author.builder().id(2).name("小红").address("星光大道").build());
        authorList.add(Author.builder().id(3).name("小绿").address("太古里").build());
        authorList.add(Author.builder().id(4).name("小得子").address("三里屯").build());
        //集合创建流
        Stream<Author> stream = authorList.stream();
        //打印id>2的且姓名长度等于3的
        stream.filter(author -> {
            Integer id = author.getId();
            int length = author.getName().length();
            if (id>2&&length==3){
                return true;
            }
            return false;
        }).forEach(author -> log.info(author.toString()));

  

 

 Stream中map使用

 @Test
    public void mapTest(){
        List<Author> authorList = new ArrayList<>();
        authorList.add(Author.builder().id(1).name("小白").address("浦东大道").build());
        authorList.add(Author.builder().id(2).name("小红").address("星光大道").build());
        authorList.add(Author.builder().id(3).name("小绿").address("太古里").build());
        authorList.add(Author.builder().id(4).name("小得子").address("三里屯").build());
        //集合创建流
        Stream<Author> stream = authorList.stream();
        stream.map(new Function<Author, String>() {

            @Override
            public String apply(Author author) {
                return author.getName();
            }
        }).forEach(new Consumer<String>() {
            @Override
            public void accept(String s) {
                log.info(s);
            }
        });
    }

  转化为lamada表达式

@Test
    public void mapTest(){
        List<Author> authorList = new ArrayList<>();
        authorList.add(Author.builder().id(1).name("小白").address("浦东大道").build());
        authorList.add(Author.builder().id(2).name("小红").address("星光大道").build());
        authorList.add(Author.builder().id(3).name("小绿").address("太古里").build());
        authorList.add(Author.builder().id(4).name("小得子").address("三里屯").build());
        //集合创建流
        Stream<Author> stream = authorList.stream();
        stream.map(author -> author.getName()).forEach(s -> log.info(s));
    }

  

 

 使用distinct去重,其中需要特别注意的是distinct实现的去重功能依赖来自Object的equals方法来判断是否是相同的对象,所以需要重写equals方法

 数据准备

package com.java.test.bean;

import lombok.Builder;
import lombok.Data;

import java.util.Objects;

/**
 * @Description:
 * @Author: Yourheart
 * @Create: 2022/10/9 23:40
 */
@Data
@Builder
public class Author extends Object{

    private Integer id;

    /**
     * 作家名称
     */
    private String name;

    /**
     * 作家的居住地址
     */
    private String address;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Author author = (Author) o;
        return Objects.equals(id, author.id) &&
                Objects.equals(name, author.name) &&
                Objects.equals(address, author.address);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, address);
    }
}

  去重前

 

 去重后

 @Test
    public void distinctTest(){
        List<Author> authorList = new ArrayList<>();
        Author build = Author.builder().id(1).name("小白").address("浦东大道").build();
        Author build1 = Author.builder().id(1).name("小白").address("浦东大道").build();
        Author build2 = Author.builder().id(1).name("小白").address("浦东大道").build();
        authorList.add(build);
        authorList.add(build1);
        authorList.add(build2);
        //集合创建流
        Stream<Author> stream = authorList.stream();
        stream.distinct().forEach(new Consumer<Author>() {
            @Override
            public void accept(Author author) {
                log.info(author.getName().toString());
            }
        });
    }

  

 flatMap使用

去重每个作家中,重复的书籍

 

去重后

 

 代码部分

@Test
    public void FlatMapTest(){
        List<Author> authorList = new ArrayList<>();
        List<Book> bookList=new ArrayList<>();
        bookList.add(Book.builder().id(1).name("讨厌的勇气").build());
        bookList.add(Book.builder().id(2).name("一封家书").build());
        Author build = Author.builder().id(1).name("小白").address("浦东大道").bookList(bookList).build();
        Author build1 = Author.builder().id(1).name("小白").address("浦东大道").bookList(bookList).build();
        Author build2 = Author.builder().id(1).name("小白").address("浦东大道").bookList(bookList).build();
        authorList.add(build);
        authorList.add(build1);
        authorList.add(build2);
        //集合创建流
        Stream<Author> stream = authorList.stream();
        stream.flatMap(author -> author.getBookList().stream())
           .distinct()
           .forEach(book -> System.out.println(book.getName()));
    }

 两个实体类

package com.java.test.bean;

import lombok.Builder;
import lombok.Data;

/**
 * @Description:
 * @Author: Yourheart
 * @Create: 2022/10/10 7:49
 */
@Data
@Builder
public class Book {

    private Integer id;

    /**
     * 书籍名称
     */
    private String name;
}

  

package com.java.test.bean;

import lombok.Builder;
import lombok.Data;

import java.util.List;
import java.util.Objects;

/**
 * @Description:
 * @Author: Yourheart
 * @Create: 2022/10/9 23:40
 */
@Data
@Builder
public class Author extends Object{

    private Integer id;

    /**
     * 作家名称
     */
    private String name;

    /**
     * 作家的居住地址
     */
    private String address;


    private List<Book> bookList;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Author author = (Author) o;
        return Objects.equals(id, author.id) &&
                Objects.equals(name, author.name) &&
                Objects.equals(address, author.address) &&
                Objects.equals(bookList, author.bookList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, address, bookList);
    }
}

  Foreach使用

@Test
    public void foreachTest(){
        List<Author> authorList = new ArrayList<>();
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(2).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(3).name("小白").address("浦东大道003").build();
        authorList.add(build);
        authorList.add(build1);
        authorList.add(build2);
        authorList.stream().forEach(new Consumer<Author>() {
            @Override
            public void accept(Author author) {
                System.out.println(author.toString());
            }
        });

    }

  

 这里插入说点内容

stream收集器

含义就是将流转化为我们想要的集合类型,就是将最终的数据收集成List、Set、Map

转化为set集合

@Test
    public void collectTest(){
        List<Author> authorList = new ArrayList<>();
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(2).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(3).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(3).name("小白").address("浦东大道003").build();
        authorList.add(build);
        authorList.add(build1);
        authorList.add(build2);
        authorList.add(build3);
        Set<Author> collect = authorList.stream().collect(Collectors.toSet());
        for (Author author : collect) {
            log.info("author:{}",author);
        }
    }

同时这里还实现了去重功能

将流转化为list集合
Collectors.toList()
将流转化为set集合
Collectors.toSet()

将实体类以key-value形式放置map集合中

 @Test
    public void collectTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(2).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(3).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(4).name("小红帽").address("浦东大道004").build();
        Map<Integer, Author> collect = Stream.of(build, build1, build2, build3).collect(Collectors.toMap(Author::getId, Function.identity()));
        Set<Map.Entry<Integer, Author>> entries = collect.entrySet();
        entries.forEach(a->{
            log.info(a.toString());
        });
    }

  

这里分别使用串行收集和并行收集打印耗时

public void collectTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道001").build();
        Author build6 = Author.builder().id(201).name("小六子").address("浦东大道002").build();
        Author build7 = Author.builder().id(302).name("小白").address("浦东大道003").build();
        Author build8= Author.builder().id(403).name("小红帽").address("浦东大道004").build();
        Author build9= Author.builder().id(12).name("小兔子").address("浦东大道001").build();
        Author build10 = Author.builder().id(22).name("小六子").address("浦东大道002").build();
        Author build11= Author.builder().id(23).name("小白").address("浦东大道003").build();
        Author build12= Author.builder().id(24).name("小红帽").address("浦东大道004").build();
        long nanoTime = System.nanoTime();
        //串行收集
        Map<Integer, Author> collect = Stream.of(build, build1, build2, build3,build5,build6,build7,build8,build9,build10,build11,build12).collect(Collectors.toMap(Author::getId, Function.identity()));
        long nanoTime1 = System.nanoTime();
        log.info("串行收集耗时:{} ns",nanoTime1-nanoTime);
        long nanoTime2 = System.nanoTime();
        //并行收集
        Map<Integer, Author> collect1 = Stream.of(build, build1, build2, build3,build5,build6,build7,build8,build9,build10,build11,build12).collect(Collectors.toMap(Author::getId, Function.identity()));
        long nanoTime3 = System.nanoTime();
        log.info("并行收集耗时:{} ns",nanoTime3-nanoTime2);
    }

  

但是需要注意的是并行收集顺序会乱,同时数据如果存在重复的会报错,这点需要注意

 前面是转化为id->Author形式

下面转化为id->name的形式

 @Test
    public void collectTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道001").build();
        Author build6 = Author.builder().id(201).name("小六子").address("浦东大道002").build();
        Author build7 = Author.builder().id(302).name("小白").address("浦东大道003").build();
        Author build8= Author.builder().id(403).name("小红帽").address("浦东大道004").build();
        Author build9= Author.builder().id(12).name("小兔子").address("浦东大道001").build();
        Author build10 = Author.builder().id(22).name("小六子").address("浦东大道002").build();
        Author build11= Author.builder().id(23).name("小白").address("浦东大道003").build();
        Author build12= Author.builder().id(24).name("小红帽").address("浦东大道004").build();
        Map<Integer, String> collect = Stream.of(build, build1, build2, build3, build5, build6, build7, build8, build9, build10, build11, build12)
                .collect(Collectors.toMap(Author::getId, Author::getName));
        collect.entrySet().forEach(a->{
            log.info(a.toString());
        });
    }

  

 下面继续说收集器中的聚合归约

@Test
    public void joinTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        String collect = Stream.of(build, build1, build2, build3, build5)
                .map(Author::getName)
                .collect(Collectors.joining("^_^"));
        log.info(collect.toString());
    }

 count使用

@Test
    public void countTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        Author build6 = Author.builder().id(12).name("小兔子3").address("浦东大道006").build();
        List<Author> collect = Stream.of(build, build1, build2, build3, build5, build6).collect(Collectors.toList());
        long count = collect.stream().count();
        log.info("打印数量:{}",count);
    }

 

 

 使用min和max获取最小值和最大值

 @Test
    public void minTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        Author build6 = Author.builder().id(12).name("小兔子3").address("浦东大道006").build();
        List<Author> collect = Stream.of(build, build1, build2, build3, build5, build6).collect(Collectors.toList());
        Optional<Integer> min = collect.stream().map(author -> author.getId())
                .min((a, b) -> a - b);
        log.info("min:{}",min.get());
        Optional<Integer> max = collect.stream().map(author -> author.getId())
                .max((a, b) -> a - b);
        log.info("max:{}",max.get());
    }

 allmatchs使用,匹配满足的条件的数据,返回值为boolean

@Test
    public void anyMatchTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        Author build6 = Author.builder().id(12).name("小兔子3").address("浦东大道006").build();
        List<Author> collect = Stream.of(build, build1, build2, build3, build5, build6).collect(Collectors.toList());
        boolean anyMatch = collect.stream().anyMatch(new Predicate<Author>() {
            @Override
            public boolean test(Author author) {
                return author.getId() > 40;
            }
        });
        log.info("anyMatch:{}",anyMatch);
    }

  

 allmatch使用,都满足条件才会返回true

 

 

 

@Test
    public void allMatchTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        Author build6 = Author.builder().id(12).name("小兔子3").address("浦东大道006").build();
        List<Author> collect = Stream.of(build, build1, build2, build3, build5, build6).collect(Collectors.toList());
        boolean allMatch = collect.stream().allMatch(new Predicate<Author>() {
            @Override
            public boolean test(Author author) {
                return author.getId() > 30;
            }
        });
        log.info("allMatch:{}",allMatch);
    }

 noneMatch表示都不匹配才会返回true,只要有一个返回就是false

 @Test
    public void noneMatchTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        Author build6 = Author.builder().id(12).name("小兔子3").address("浦东大道006").build();
        List<Author> collect = Stream.of(build, build1, build2, build3, build5, build6).collect(Collectors.toList());
        boolean noneMatch = collect.stream().noneMatch(new Predicate<Author>() {
            @Override
            public boolean test(Author author) {
                return author.getName().contains("小兔");
            }
        });
        log.info("noneMatch:{}",noneMatch);
    }

  @Test
    public void noneMatchTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        Author build6 = Author.builder().id(12).name("小兔子3").address("浦东大道006").build();
        List<Author> collect = Stream.of(build, build1, build2, build3, build5, build6).collect(Collectors.toList());
        boolean noneMatch = collect.stream().noneMatch(new Predicate<Author>() {
            @Override
            public boolean test(Author author) {
                return author.getName().contains("萝卜");
            }
        });
        log.info("noneMatch:{}",noneMatch);
    }

findFirst使用,查询满足条件的第一个元素

@Test
    public void findAnyTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(21).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(41).name("小红帽").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        Author build6 = Author.builder().id(12).name("小兔子3").address("浦东大道006").build();
        List<Author> collect = Stream.of(build, build1, build2, build3, build5, build6).collect(Collectors.toList());
        Optional<Author> first = collect.stream().filter(new Predicate<Author>() {
            @Override
            public boolean test(Author author) {
                return author.getId() > 15;
            }
        }).findFirst();
        Author author = first.get();
        log.info("author:{}",author);
    }

  

 

 groupBy分组

@Test
    public void groupByTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(1).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(31).name("小红帽").address("浦东大道004").build();
        Author build4= Author.builder().id(31).name("小红帽1").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        Author build6 = Author.builder().id(12).name("小兔子3").address("浦东大道006").build();
        List<Author> authorList=new ArrayList<>();
        authorList.add(build);
        authorList.add(build1);
        authorList.add(build2);
        authorList.add(build3);
        authorList.add(build4);
        authorList.add(build5);
        authorList.add(build6);
        Map<Integer, List<Author>> collect = authorList.stream().collect(Collectors.groupingBy(Author::getId));
        collect.entrySet().forEach(a->{
            log.info(a.toString());
        });
    }

 reduce使用求和

@Test
    public void reduceTest(){
        Author build = Author.builder().id(1).name("小兔子").address("浦东大道001").build();
        Author build1 = Author.builder().id(1).name("小六子").address("浦东大道002").build();
        Author build2 = Author.builder().id(31).name("小白").address("浦东大道003").build();
        Author build3= Author.builder().id(31).name("小红帽").address("浦东大道004").build();
        Author build4= Author.builder().id(31).name("小红帽1").address("浦东大道004").build();
        Author build5 = Author.builder().id(11).name("小兔子").address("浦东大道005").build();
        Author build6 = Author.builder().id(12).name("小兔子3").address("浦东大道006").build();
        List<Author> authorList=new ArrayList<>();
        authorList.add(build);
        authorList.add(build1);
        authorList.add(build2);
        authorList.add(build3);
        authorList.add(build4);
        authorList.add(build5);
        authorList.add(build6);
        Integer reduce = authorList.stream().map(author -> author.getId())
                .reduce(0, new BinaryOperator<Integer>() {
                    @Override
                    public Integer apply(Integer result, Integer element) {

                        return result + element;
                    }
                });
        log.info("reduce:{}",reduce);
    }

 

 最后附上pom文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.java</groupId>
    <artifactId>test-study</artifactId>
    <version>1.0-SNAPSHOT</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.1.RELEASE</version>
        <relativePath/>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!--lombok依赖-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.16</version>
        </dependency>
        <!--引入junit单元测试依赖-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>

    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <finalName>study</finalName>
    </build>


</project>

  

标签:name,Stream,Author,builder,简单,build,使用,id,address
From: https://www.cnblogs.com/q202105271618/p/16774143.html

相关文章

  • 【汇编】最简单的汇编程序:实现清屏(.asm源码)
    项目环境编译环境:搭建一个nasm2.8的编译环境。镜像文件:采用winhex_18.2刷入编码。虚拟机:采用Bochs-2.4.5。项目软件傻瓜式环境配置。解压文件到D盘能直接使用。程序介绍汇编......
  • 【汇编】封装实现界面绘制,一个简单的记事本(.asm源码)
    项目环境编译环境:搭建一个nasm2.8的编译环境。镜像文件:采用winhex_18.2刷入编码。虚拟机:采用Bochs-2.4.5。项目软件傻瓜式环境配置。解压文件到D盘能直接使用。运行结果程序......
  • dremio HomeFileSystemStoragePlugin简单介绍
    使用过dremio的同学应该了解dremio对于每个用户会支持一个@的导航(小房子标记)参考接口效果restapi请求的,会包含一个containerTypehome的就是HomeFileSystemStorage......
  • Eclipse使用技巧
    介绍各位使用Eclipse作为开发IDE的看客们,Eclipse的一些使用技巧您都知道吗?本文会介绍一些很实用的快捷键。快捷键Ctrl+Shift+L弹出快捷键说明进入或退出块选择模式Alt+Sh......
  • 使用PDF Arrange移除PDF文件的“安全模式”
    以前就写过一篇博客《​​使用pdfsam来移除PDF文件的安全模式​​》,在这篇文章中是使用pdfsam来对PDF文件进行某种程度的“破坏”,然后“重建”另一个PDF文件,从而达到移除“......
  • Eclipse中Tomcat插件的使用说明
    打开Tomcat视图通过菜单Window->ShowView->Other然后输入过滤项Servers,选择找到的内容然后点OK即可。添加web项目如果在打开的Tomcat视图中已经有一个实例,则右键菜单Addan......
  • python爬虫从0到1 -Requests库的基本使用(get/post请求)
    文章目录​​前言​​​​(一)requests的get请求​​​​1.导入requests库​​​​2.定义url地址以及请求头​​​​3.返回响应数据​​​​4.将数据打印​​​​总结(对比......
  • 软件测试很简单么?
    有个不是很好笑的笑话,说的是某某公司扫地的大妈都可以做软件测试,某某公司看门的大爷都可以做软件测试。导致现在还有很多人对测试的认知都停留在这个层面上。想当初,个人也......
  • 《Rust唠嗑室》第36期 - 分享使用Rust进行嵌入式开发创业的一些点滴
    题目:分享使用Rust进行嵌入式开发创业的一些点滴主讲人:cz内容: 一.创业项目为什么选择Rust进行嵌入式开发(ForSTM32)?二.根据项目选用哪些Rustcrates? 三.Rust在嵌入......
  • go channel原理及使用场景
    ​​gochannel原理及使用场景​​源码解析typehchanstruct{qcountuint//Channel中的元素个数dataqsizuint//Channel中的循环队列的......