Implicit fallback converter for Object, CharSequence and Serializable
See original GitHub issueString
extends Object
and implements CharSequence
and Serializable
. It makes no sense to force users to write their own no-op converters if these types are requested. Instead there should be a fallback to simply cast to the requested type, if no explicitly registered converter for the type is found, and the value could be cast to the requested type (i. e., the requested type is either Object
, CharSequence
or Serializable
):
if (no_converter_found && no_implicit_conversion_found && Arrays.asList(Object.class, CharSequence.class, Serializable.class).contains(requestedClass))
return requestedClass.cast(propertyValue);
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
System.Text.Json source generator fallback - .NET
Text.Json source generator will no longer implicitly fall back to reflection-based serialization for unrecognized types. Previous behavior.
Read more >Scala implicit Long to Serializable - java - Stack Overflow
An implicit won't make scala.Long extend Serializable . You can either use java.lang.Long or create a class like case class SerializableLong(x: Long) ...
Read more >StringValue - Saxonica
Convert to Java object (for passing to external functions) ... Note that although a StringValue may wrap any kind of CharSequence (usually a...
Read more >StringBuilder - Scala 3 - EPFL
def append(cs: CharSequence): StringBuilder ... Convert collection to array. Convert collection to array. ... Returns a string representation of the object.
Read more >Scio 0.7: a deep dive - Spotify Engineering
Luckily Kryo happens to serialize the CharSequence type as a UTF-8 ... wraps the implicitly scoped Coder as a com.spotify.scio.coders.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oops, missed your original answer. Sorry for that. Please keep it open for short, I will answer ASAP.
@mkarg any additional comments? I’d like to either move this issue forward or close it.