Class ArrayTypeConverter

  • All Implemented Interfaces:
    TypeConverter

    @MetaInfServices(TypeConverter.class)
    public class ArrayTypeConverter
    extends Object
    implements TypeConverter
    Type Converter to convert objects into Arrays. Uses CollectionTypeConverter to convert the object into a collection and then constructs the required array. Is capable of handling primitive arrays as well as object arrays.
    Author:
    David B. Bracewell
    • Constructor Detail

      • ArrayTypeConverter

        public ArrayTypeConverter()
    • Method Detail

      • convert

        public Object convert​(Object source,
                              Type... parameters)
                       throws TypeConversionException
        Description copied from interface: TypeConverter
        Converts an object from one type to another.
        Specified by:
        convert in interface TypeConverter
        Parameters:
        source - the source object
        parameters - the optional type parameters when using Generics.
        Returns:
        the converted object
        Throws:
        TypeConversionException - the source object was not able to be converted to the target type
      • getConversionType

        public Class[] getConversionType()
        Description copied from interface: TypeConverter
        Array of classes that this type converter can convert objects to
        Specified by:
        getConversionType in interface TypeConverter
        Returns:
        the classes that this converter can convert to