Expand on ConfigurationSerializable methods in ConfigurationSection

By: Senmori <thesenmori@gmail.com>
This commit is contained in:
Bukkit/Spigot
2018-03-15 20:53:18 +11:00
parent e57e2489b5
commit 2496f119f4
3 changed files with 62 additions and 26 deletions
@@ -6,6 +6,7 @@ import java.util.List;
import org.bukkit.Color;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.util.Vector;
import org.bukkit.inventory.ItemStack;
@@ -606,6 +607,38 @@ public interface ConfigurationSection {
public List<Map<?, ?>> getMapList(String path);
// Bukkit
/**
* Gets the requested {@link ConfigurationSerializable} object at the given
* path.
*
* If the Object does not exist but a default value has been specified, this
* will return the default value. If the Object does not exist and no
* default value was specified, this will return null.
*
* @param <T> the type of {@link ConfigurationSerializable}
* @param path the path to the object.
* @param clazz the type of {@link ConfigurationSerializable}
* @return Requested {@link ConfigurationSerializable} object
*/
public <T extends ConfigurationSerializable> T getSerializable(String path, Class<T> clazz);
/**
* Gets the requested {@link ConfigurationSerializable} object at the given
* path, returning a default value if not found
*
* If the Object does not exist then the specified default value will
* returned regardless of if a default has been identified in the root
* {@link Configuration}.
*
* @param <T> the type of {@link ConfigurationSerializable}
* @param path the path to the object.
* @param clazz the type of {@link ConfigurationSerializable}
* @param def the default object to return if the object is not present at
* the path
* @return Requested {@link ConfigurationSerializable} object
*/
public <T extends ConfigurationSerializable> T getSerializable(String path, Class<T> clazz, T def);
/**
* Gets the requested Vector by path.
* <p>