class SupplierConverter implements PropertyConverter<Supplier> {

    @Override
    public Supplier convert(String value, ConversionContext context) {
        return () -> {
            try{
                Type targetType = context.getTargetType().getType();
                ParameterizedType pt = (ParameterizedType) targetType;
                if(String.class.equals(pt.getActualTypeArguments()[0])){
                    return value;
                }
                ConvertQuery converter = new ConvertQuery(value, TypeLiteral.of(pt.getActualTypeArguments()[0]));
                Object o = context.getConfiguration().adapt(converter);
                if(o==null){
                    throw new ConfigException("No such createValue: " + context.getKey());
                }
                return o;
            }catch(Exception e){
                throw new ConfigException("Error evaluating config createValue.", e);
            }
        };
    }

}