Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request for automatic detection of parameterized List's #27

Open
The-Alchemist opened this issue Apr 1, 2015 · 2 comments
Open

request for automatic detection of parameterized List's #27

The-Alchemist opened this issue Apr 1, 2015 · 2 comments

Comments

@The-Alchemist
Copy link
Contributor

If we have:

public class Machines {
    public List<Machine> machines;
}

public class Machine {
    public String machine_used;
    public List<Measurement> measurements;
}

I have to say:

        yamlConfig.setPropertyElementType(Machines.class, "machines", Machine.class);
        yamlConfig.setPropertyElementType(Machine.class, "measurements", Measurement.class);

Couldn't yamlbeans conceivably use the generic parameter of the List as a safe default?

I can submit a pull request, if it has a decent chance of getting accepted. :)

@NathanSweet
Copy link
Member

Yes, it could. A PR would be merged if the changes are relatively small. You can see how JsonBeans does it. Supporting only a single generic type like that is reasonable, I don't think it's worth the complexity to do more.

@daimonion
Copy link

I would certainly vote for that feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants