class RecordFieldSetMapper<T> implements FieldSetMapper<T> {

	private final SimpleTypeConverter typeConverter = new SimpleTypeConverter();

	private final Constructor<T> mappedConstructor;

	private String[] constructorParameterNames;

	private Class<?>[] constructorParameterTypes;

	/**
	 * Create a new {@link RecordFieldSetMapper}.
	 * @param targetType type of mapped items
	 */
	public RecordFieldSetMapper(Class<T> targetType) {
		this(targetType, new DefaultConversionService());
	}

	/**
	 * Create a new {@link RecordFieldSetMapper}.
	 * @param targetType type of mapped items
	 * @param conversionService service to use to convert raw data to typed fields
	 */
	public RecordFieldSetMapper(Class<T> targetType, ConversionService conversionService) {
		this.typeConverter.setConversionService(conversionService);
		this.mappedConstructor = BeanUtils.getResolvableConstructor(targetType);
		if (this.mappedConstructor.getParameterCount() > 0) {
			this.constructorParameterNames = BeanUtils.getParameterNames(this.mappedConstructor);
			this.constructorParameterTypes = this.mappedConstructor.getParameterTypes();
		}
	}

	@Override
	public T mapFieldSet(FieldSet fieldSet) {<FILL_FUNCTION_BODY>}

}

		Assert.isTrue(fieldSet.getFieldCount() == this.constructorParameterNames.length,
				"Fields count must be equal to record components count");
		Assert.isTrue(fieldSet.hasNames(), "Field names must specified");
		Object[] args = new Object[0];
		if (this.constructorParameterNames != null && this.constructorParameterTypes != null) {
			args = new Object[this.constructorParameterNames.length];
			for (int i = 0; i < args.length; i++) {
				String name = this.constructorParameterNames[i];
				Class<?> type = this.constructorParameterTypes[i];
				args[i] = this.typeConverter.convertIfNecessary(fieldSet.readRawString(name), type);
			}
		}
		return BeanUtils.instantiateClass(this.mappedConstructor, args);
	
<no_super_class>