Skip to content

request for automatic detection of parameterized List's #27

Open

Description

@The-Alchemist

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. :)

Activity

  1. NathanSweet commented on Apr 1, 2015

    @NathanSweet
    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.

  2. daimonion commented on Jan 22, 2016

    @daimonion

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions