Package xyz.srnyx.annoyingapi.file
Class AnnoyingFile.Options<G extends AnnoyingFile.Options<G>>
java.lang.Object
xyz.srnyx.javautilities.parents.Stringable
xyz.srnyx.annoyingapi.file.AnnoyingFile.Options<G>
- Type Parameters:
G- the type of theAnnoyingFile.Optionsinstance
- Direct Known Subclasses:
AnnoyingResource.Options
- Enclosing class:
AnnoyingFile<T extends AnnoyingFile<T>>
public static class AnnoyingFile.Options<G extends AnnoyingFile.Options<G>>
extends xyz.srnyx.javautilities.parents.Stringable
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanWhether the file can be empty.booleanWhether to replace the file if it already exists. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncanBeEmpty(boolean canBeEmpty) Sets thecanBeEmptystatic <H extends AnnoyingFile.Options<H>>
Hload(H options, @NotNull org.bukkit.configuration.ConfigurationSection section) Loads aAnnoyingFile.Optionsfrom the givenConfigurationSectionstatic <R extends AnnoyingFile.Options<R>>
@NotNull AnnoyingFile.Options<R> load(@NotNull org.bukkit.configuration.ConfigurationSection section) Loads aAnnoyingFile.Optionsfrom the givenConfigurationSectionreplace(boolean replace) Sets thereplaceMethods inherited from class xyz.srnyx.javautilities.parents.Stringable
toString, toString, toString, toString, toString
-
Field Details
-
canBeEmpty
public boolean canBeEmptyWhether the file can be empty. If false, the file will be deleted if it's empty whenAnnoyingFile.save()is used -
replace
public boolean replaceWhether to replace the file if it already exists. Works best withcanBeEmptyset totrue
-
-
Constructor Details
-
Options
public Options()Creates a newAnnoyingFile.Optionsinstance
-
-
Method Details
-
load
@NotNull public static <H extends AnnoyingFile.Options<H>> H load(@NotNull H options, @NotNull @NotNull org.bukkit.configuration.ConfigurationSection section) Loads aAnnoyingFile.Optionsfrom the givenConfigurationSection- Type Parameters:
H- the type of theAnnoyingFile.Optionsinstance- Parameters:
options- theAnnoyingFile.Optionsto load intosection- theConfigurationSectionto load from- Returns:
- the
AnnoyingFile.Optionsinstance
-
load
@NotNull public static <R extends AnnoyingFile.Options<R>> @NotNull AnnoyingFile.Options<R> load(@NotNull @NotNull org.bukkit.configuration.ConfigurationSection section) Loads aAnnoyingFile.Optionsfrom the givenConfigurationSection- Type Parameters:
R- the type of theAnnoyingFile.Optionsinstance- Parameters:
section- theConfigurationSectionto load from- Returns:
- the
AnnoyingFile.Optionsinstance
-
canBeEmpty
Sets thecanBeEmpty- Parameters:
canBeEmpty-canBeEmpty- Returns:
- the
AnnoyingFile.Optionsinstance
-
replace
Sets thereplace- Parameters:
replace-replace- Returns:
- the
AnnoyingFile.Optionsinstance
-