All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fredericboisguerin.excel.converter.ConverterHelper Maven / Gradle / Ivy

package com.fredericboisguerin.excel.converter;

import com.fredericboisguerin.excel.common.InformationType;

/**
 * Created by fboisguerin on 22/07/2015.
 */
public class ConverterHelper {

    public static Converter getConverter(InformationType informationType) {
        switch (informationType) {
            case BOOLEAN:
                return BooleanConverter.getInstance();
            case DATE:
                return DateConverter.getInstance();
            case DOUBLE:
                return DoubleConverter.getInstance();
            case LONG:
                return LongConverter.getInstance();
            case STRING:
                return StringConverter.getInstance();
            default:
                throw new IllegalArgumentException(
                        String.format("The information type %s is not associated with a converter.", informationType)
                );
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy