Handle multiple concrete classes
A java class can declare a field as an interface and in theory use multiple classes to implement it. Mapping one of these classes to rust may require a different conversion and/or a different final struct.
First approach might be to wrap possible implementations in enums and add a step to FromValue to check class names.
#[java(interface)]
enum Collection<T> {
List(List<T>),
Set(Set<T>),
}
#[java(interface)]
enum List<T> {
#[java(class = "java.util.ArrayList")]
ArrayList(Vec<T>),
#[java(class = "java.util.LinkedList")]
LinkedList(LinkedList<T>),
}
#[java(interface)]
enum Set<T> {
#[java(class = "java.util.HashSet")]
HashSet(HashSet<T>),
#[java(class = "java.util.LinkedHashSet")]
LinkedHashSet(???<T>),
#[java(class = "java.util.TreeSet")]
TreeSet(BTreeSet<T>),
}
The implementation for collection could have to_list/to_set methods etc. Or impl Deref<Vec>.
Edited by Woolly Gibbon