How to get the name of a section that contains a String

Asked

Viewed 34 times

1

The code serves to get all the sections in the YML file, so far it is working, but I do not know how to get the section that contains the name "So-and-so", for example:

Grupos:
 Usuário:
   pessoas:
   - Fulano
 Dono:
   pessoas:

Code to pick up all sections:

for (String grupos : ConfigManager.get("arquivo.yml").getConfigurationSection("Grupos")
                        .getKeys(false)) {
}

I wanted you to check all the groups and return the name of the group that contains the name "John Doe" But I have no idea how to do it, can you please help me?

  • This class ConfigManager is from Spring?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.