Class CollectionConverter

java.lang.Object
org.miaixz.bus.core.convert.CollectionConverter
All Implemented Interfaces:
Converter

public class CollectionConverter extends Object implements Converter
各种集合类转换器
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

  • Constructor Details

    • CollectionConverter

      public CollectionConverter()
  • Method Details

    • convert

      public Collection<?> convert(Type targetType, Object value)
      Description copied from interface: Converter
      转换为指定类型 如果类型无法确定,将读取默认值的类型做为目标类型
      Specified by:
      convert in interface Converter
      Parameters:
      targetType - 目标Type,非泛型类使用
      value - 原始值,如果对象实现了此接口,则value为this
      Returns:
      转换后的值
    • convert

      public Collection<?> convert(Type collectionType, Type elementType, Object value)
      转换
      Parameters:
      collectionType - 集合类型
      elementType - 集合中元素类型
      value - 被转换的值
      Returns:
      转换后的集合对象