From 48feb74b19cf9e3694bd022fc6e4c22f906985af Mon Sep 17 00:00:00 2001
From: Bukkit/Spigot <noreply+git-bukkit@papermc.io>
Date: Sun, 16 Jan 2011 13:28:59 -0800
Subject: [PATCH] Added Configuration.getKeys().

By: sk89q <the.sk89q@gmail.com>
---
 .../bukkit/util/config/ConfigurationNode.java | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/paper-api/src/main/java/org/bukkit/util/config/ConfigurationNode.java b/paper-api/src/main/java/org/bukkit/util/config/ConfigurationNode.java
index 60956c139d..ead13a7cac 100644
--- a/paper-api/src/main/java/org/bukkit/util/config/ConfigurationNode.java
+++ b/paper-api/src/main/java/org/bukkit/util/config/ConfigurationNode.java
@@ -149,6 +149,25 @@ public abstract class ConfigurationNode {
             return o;
         }
     }
+    
+    /**
+     * Get a list of keys at a location. If the map at the particular location
+     * does not exist or it is not a map, null will be returned.
+     * 
+     * @param path path to node (dot notation)
+     * @return list of keys
+     */
+    @SuppressWarnings("unchecked")
+    public List<String> getKeys(String path) {
+        Object o = getProperty(path);
+        if (o == null) {
+            return null;
+        } else if (o instanceof Map) {
+            return new ArrayList<String>(((Map<String,Object>)o).keySet());
+        } else {
+            return null;
+        }
+    }
 
     /**
      * Gets a list of objects at a location. If the list is not defined,