I don't see any problem doing this way,  many api has been used this
strategy, because is a good practice use interface instead implementation.

And in CharSequence interface we have the method to convert to String.

https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html

Some Examples:

https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html#parse-java.lang.CharSequence-

https://github.com/JavaMoney/jsr354-ri/blob/master/src/main/java/org/javamoney/moneta/Money.java

https://github.com/JavaMoney/jsr354-api/blob/master/src/main/java/javax/money/format/MonetaryAmountFormat.java


On Dec 1, 2014 6:14 AM, "Oliver B. Fischer" <[email protected]>
wrote:

> 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
>
>

Reply via email to