对 Spring 一些工具类的索引

Spring(和 Spring Boot) 提供了非常多实用的工具类,考虑到当前 Spring 已经成为 Java EE 开发的事实标准,学习 Spring 的工具类并将其运用到开发中是非常有意义的,特别是对于各种反射操作

本来是想去系统学习一下的,但想想又没有必要,等用到的时候再去具体了解吧!但做一个索引供查阅还是比较有意义的。下面为我觉得比较重要的工具类,一级表项为项目名:

  • spring-boot:
    • org.springframework.boot.context.properties.PropertyMapper(手动 Bean 映射工具)
    • org.springframework.boot.task.TaskExecutorBuilder(线程池 Builder)
  • spring-core:
    • org.springframework.util.function.SingletonSupplier(“惰性求值”的 Supplier)
    • org.springframework.util.ClassUtils(获取类的各种属性)
    • org.springframework.util.CollectionUtils(各种集合操作)
    • org.springframework.util.PatternMatchUtils(仅实现*的字符串匹配工具,应当比正则更高效)
    • org.springframework.util.ReflectionUtils(各种奇妙的反射操作,相较于 ClassUtils 更倾向于去 make effect)
    • org.springframework.util.StopWatch(简单计时工具)
    • org.springframework.util.StreamUtils(IO 流操作)
    • org.springframework.util.StringUtils(常用字符串操作)
    • org.springframework.util.TypeUtils(继承关系计算)
    • org.springframework.core.annotation.AnnotatedElementUtils(注解获取)
  • spring-data-commons(这些类居然放在 spring-data 下……但一般来说都会引用 redis,因此会引用该包):
    • org.springframework.data.util.StreamUtils(java8 Stream 操作,终于有 zip 了呜呜呜)
    • org.springframework.data.util.Optionals(关于 Optional 的一些操作)
    • org.springframework.data.util.ParsingUtils(切分驼峰命名法字符串)

其中,有一些我感觉比较重要,但是不知道应用场景/没能力去使用的工具,需要对并发去进一步学习:

  • spring-core:
    • org.springframework.util.AutoPopulatingList
    • org.springframework.util.concurrent 包下的各种 Future

本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 协议 ,转载请注明出处!