@Test public void shouldSaveDefaults() { configurationLoader.load(); String name = yamlConfiguration.getString("firstName"); assertNotNull(name); assertEquals("Your name", name); String lastName = yamlConfiguration.getString("lastName"); assertNull(lastName); int age = yamlConfiguration.getInt("age"); assertEquals(0, age); }
@Nullable public static <T> T load(@NotNull Plugin plugin, @NotNull Class<T> clazz) { Objects.requireNonNull(plugin, "plugin is null"); return load(plugin, plugin.getConfig(), clazz); }
BukkitConfigurationLoader extends ConfigurationLoader<T, ConfigurationSection> { @Nullable public static <T> T load(@NotNull Plugin plugin, @NotNull Class<T> clazz) { Objects.requireNonNull(plugin, "plugin is null"); return load(plugin, plugin.getConfig(), clazz); } }
BukkitConfigurationLoader extends ConfigurationLoader<T, ConfigurationSection> { @Nullable public static <T> T load(@NotNull Plugin plugin, @NotNull Class<T> clazz) { Objects.requireNonNull(plugin, "plugin is null"); return load(plugin, plugin.getConfig(), clazz); } BukkitConfigurationLoader(@NotNull ConfigurationSection config, Runnable saveConfig, @NotNull Class<T> clazz); }
BukkitConfigurationLoader extends ConfigurationLoader<T, ConfigurationSection> { @Nullable public static <T> T load(@NotNull Plugin plugin, @NotNull Class<T> clazz) { Objects.requireNonNull(plugin, "plugin is null"); return load(plugin, plugin.getConfig(), clazz); } BukkitConfigurationLoader(@NotNull ConfigurationSection config, Runnable saveConfig, @NotNull Class<T> clazz); @Nullable static T load(@NotNull Plugin plugin, @NotNull Class<T> clazz); @Nullable static T load(@NotNull Plugin plugin, @NotNull String section, @NotNull Class<T> clazz); @Nullable static T load(@NotNull Plugin plugin, @NotNull ConfigurationSection config, @NotNull Class<T> clazz); @Nullable static T load(@NotNull ConfigurationSection config, Runnable saveConfig, @NotNull Class<T> clazz); @Override Object getConfigValue(AnnotatedField field, @Nullable Object defaultValue); @Override void setConfigValue(AnnotatedField field, @Nullable Object value); @Override void registerTypeAdapter(@NotNull final TypeAdapter<?> typeAdapter); }
BukkitConfigurationLoader extends ConfigurationLoader<T, ConfigurationSection> { @Nullable public static <T> T load(@NotNull Plugin plugin, @NotNull Class<T> clazz) { Objects.requireNonNull(plugin, "plugin is null"); return load(plugin, plugin.getConfig(), clazz); } BukkitConfigurationLoader(@NotNull ConfigurationSection config, Runnable saveConfig, @NotNull Class<T> clazz); @Nullable static T load(@NotNull Plugin plugin, @NotNull Class<T> clazz); @Nullable static T load(@NotNull Plugin plugin, @NotNull String section, @NotNull Class<T> clazz); @Nullable static T load(@NotNull Plugin plugin, @NotNull ConfigurationSection config, @NotNull Class<T> clazz); @Nullable static T load(@NotNull ConfigurationSection config, Runnable saveConfig, @NotNull Class<T> clazz); @Override Object getConfigValue(AnnotatedField field, @Nullable Object defaultValue); @Override void setConfigValue(AnnotatedField field, @Nullable Object value); @Override void registerTypeAdapter(@NotNull final TypeAdapter<?> typeAdapter); static final BukkitTypeAdapterFactory TYPE_ADAPTER_FACTORY; }