This is what I'm thinking: a Groovy based configuration space defines a
key/value pair in the following manner
my.weird.groovy.key = "This is some ${adjective} value"
This happens to be a Groovy String. This kind of strings extend directly
from CharSequence and can be converted on the fly to java.lang.String.
The use case is to receive the Groovy String as is, iow, you don't want
conversion to happen. If you do you may encounter a runtime error because
the value of the free variable (adjective) may not be bound.
If the target property is of type CharSequence then the Groovy String can
be applied to it with no type conversion. If the type is String then
conversion takes place and it will most likely fail
Cheers,
Andres
-------------------------------------------
Java Champion; Groovy Enthusiast
http://jroller.com/aalmiray
http://www.linkedin.com/in/aalmiray
--
What goes up, must come down. Ask any system administrator.
There are 10 types of people in the world: Those who understand binary, and
those who don't.
To understand recursion, we must first understand recursion.
On Mon, Dec 1, 2014 at 5:23 PM, Oliver B. Fischer <[email protected]>
wrote:
> @Andres: You mentioned that Groovy could benefit from it. Could you
> explain it a little bit more so that we could decide based on some usecases?
>
> Oliver
>
> Am 01.12.14 16:13, schrieb Tresch, Anatole:
>
> +1 String support is mandatory. CharSequence for me, often is a good
>> thing, but sometimes also is simply not needed. Typically it is very
>> useful, where you have some kind of String handling in place, as it is
>> typical for parsing or formatting. In cases where you typically pass
>> constant keys only, I see only limited advantages (or even disadvantages by
>> bloating the API, creating unnecessary Strings ...).
>>
>> So I would ask for concrete proposals where to add it, so we can focus
>> discussion on the concrete cases ;)
>>
>> -Anatole
>>
>>
>>
>> -----Original Message-----
>> From: Romain Manni-Bucau [mailto:[email protected]]
>> Sent: Montag, 1. Dezember 2014 09:43
>> To: [email protected]
>> Subject: Re: CharSequence instead of String
>>
>> think we should support String so CharSequence would be another
>> supported type. Main reason is valueOf(String) or fromString(String)
>> is common in several specs.
>>
>> No issues supporting both but not supporting string would be quite
>> uncommon for me, wdyt?
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau
>> http://www.tomitribe.com
>> http://rmannibucau.wordpress.com
>> https://github.com/rmannibucau
>>
>>
>> 2014-12-01 9:12 GMT+01:00 Oliver B. Fischer <[email protected]>:
>>
>>> Hi,
>>>
>>> after our dicussing the data type conversion topic I got the impression
>>> what
>>> we should use
>>>
>>> 1. CharSequence as basic data type
>>>
>>> Is this true for all of us?
>>>
>>> How does it affect our API? Should we use CharSequence consistently in
>>> our
>>> API?
>>>
>>> wdyt?
>>>
>>> Oliver
>>>
>>> --
>>> N Oliver B. Fischer
>>> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
>>> P +49 30 44793251
>>> M +49 178 7903538
>>> E [email protected]
>>> S oliver.b.fischer
>>> J [email protected]
>>> X http://xing.to/obf
>>>
>>>
> --
> N Oliver B. Fischer
> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
> P +49 30 44793251
> M +49 178 7903538
> E [email protected]
> S oliver.b.fischer
> J [email protected]
> X http://xing.to/obf
>
>