Hi,
Emmanuel Bourg wrote:
Le 14/08/2013 17:39, Adrian Crum a écrit :
Instead of
int columnInt = record.getValueAsInt(1);
the developer would use
Integer columnInt = Util.convertTo(record.getValue(1), Integer.class);
+1 for the static method, that would allow the use of a static
I personally think we're over-thinking this thing. Keep it simple, folks:
public interface ConverterF,T
{
T convert(F from);
}
You can auto-detect the F/T parameters when a Converter is registered.
On Thu, Aug 15, 2013 at 4:42 AM, Jörg Schaible
joerg.schai...@scalaris.com wrote:
Hi,
Should the framework try to convert transitively?
Gary
On Aug 15, 2013, at 6:56, James Carman ja...@carmanconsulting.com wrote:
I personally think we're over-thinking this thing. Keep it simple, folks:
public interface ConverterF,T
{
T convert(F from);
}
You can auto-detect the F/T
You mean if it has a converter from A - B and B - C and you ask for
a conversion from A - C, it would figure it out? That's and
interesting idea. I guess you'd need to make sure there is no loss of
fidelity when doing the conversions.
On Thu, Aug 15, 2013 at 8:00 AM, Gary Gregory
On Thu, Aug 15, 2013 at 9:09 AM, James Carman ja...@carmanconsulting.comwrote:
You mean if it has a converter from A - B and B - C and you ask for
a conversion from A - C, it would figure it out? That's and
interesting idea. I guess you'd need to make sure there is no loss of
fidelity when
Perhaps you'd have a different method on the registry like this:
ConverterF,T createConverterPath(ClassF fromType, ClassT toType);
This way, you're specifically letting the registry know that you're
okay with it filling in the blanks in between fromType and toType.
On Thu, Aug 15, 2013 at 9:24
Am 15.08.2013 15:33, schrieb James Carman:
Perhaps you'd have a different method on the registry like this:
ConverterF,T createConverterPath(ClassF fromType, ClassT toType);
This way, you're specifically letting the registry know that you're
okay with it filling in the blanks in between
I'm okay with layers too. You need to open up the API for querying so that
upper layers can traverse the graph.
On Thursday, August 15, 2013, Oliver Heger wrote:
Am 15.08.2013 15:33, schrieb James Carman:
Perhaps you'd have a different method on the registry like this:
ConverterF,T
On Tue, Aug 13, 2013 at 4:01 PM, Oliver Heger
oliver.he...@oliver-heger.dewrote:
Hi all,
recently, there was a discussion about extending the [csv] interface to
provide data conversions to different types. If such a use case is to be
supported, what would be the best approach to integrate a
I don't think CSV needs anything special to accommodate type conversion.
The pattern I tried to introduce in the Commons Convert Getting
Started section is one that works in any part of an application where
conversion might be needed. So, instead of hard-coding conversions, the
developer
Am 14.08.2013 16:54, schrieb Gary Gregory:
On Tue, Aug 13, 2013 at 4:01 PM, Oliver Heger
oliver.he...@oliver-heger.dewrote:
Hi all,
recently, there was a discussion about extending the [csv] interface to
provide data conversions to different types. If such a use case is to be
supported,
Am 14.08.2013 17:39, schrieb Adrian Crum:
I don't think CSV needs anything special to accommodate type conversion.
The pattern I tried to introduce in the Commons Convert Getting
Started section is one that works in any part of an application where
conversion might be needed. So, instead of
Le 14/08/2013 17:39, Adrian Crum a écrit :
Instead of
int columnInt = record.getValueAsInt(1);
the developer would use
Integer columnInt = Util.convertTo(record.getValue(1), Integer.class);
+1 for the static method, that would allow the use of a static import
and a very concise syntax
The only danger of static methods is that you can't override them.
BeanUtils first suffered from this fate and they then made an instance
version (BeanUtils2). Just said plainly, you can't customize well using
factory classes/methods.
On Wed, Aug 14, 2013 at 3:04 PM, Emmanuel Bourg
On Wed, Aug 14, 2013 at 4:04 PM, Emmanuel Bourg ebo...@apache.org wrote:
That being said, [convert] could offer several patterns to perform type
conversion, and the use of proxies could be one of them.
I know of a project that might be able to help you with those proxies, too! :)
Hi all,
recently, there was a discussion about extending the [csv] interface to
provide data conversions to different types. If such a use case is to be
supported, what would be the best approach to integrate a library like
[convert]? Doing all required conversions manually would probably mean a
16 matches
Mail list logo