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

1

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

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

Code to get all sections:

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

I wanted you to check all groups and return the name of the group that contains the name "So-and-so" But I do not have the slightest idea how to do it, can you help me please?

    
asked by anonymous 19.07.2018 / 17:43

0 answers