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
Fields Modifier and Type Field Description booleancanBeEmptyWhether the file can be empty.booleanreplaceWhether to replace the file if it already exists.
-
Constructor Summary
Constructors Constructor Description Options()Creates a newAnnoyingFile.Optionsinstance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GcanBeEmpty(boolean canBeEmpty)Sets thecanBeEmptystatic <R extends AnnoyingFile.Options<R>>
@NotNull AnnoyingFile.Options<R>load(@NotNull org.bukkit.configuration.ConfigurationSection section)Loads aAnnoyingFile.Optionsfrom the givenConfigurationSectionstatic <H extends AnnoyingFile.Options<H>>
Hload(H options, @NotNull org.bukkit.configuration.ConfigurationSection section)Loads aAnnoyingFile.Optionsfrom the givenConfigurationSectionGreplace(boolean replace)Sets thereplace
-
-
-
Field Detail
-
canBeEmpty
public boolean canBeEmpty
Whether the file can be empty. If false, the file will be deleted if it's empty whenAnnoyingFile.save()is used
-
replace
public boolean replace
Whether to replace the file if it already exists. Works best withcanBeEmptyset totrue
-
-
Constructor Detail
-
Options
public Options()
Creates a newAnnoyingFile.Optionsinstance
-
-
Method Detail
-
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
@NotNull public G canBeEmpty(boolean canBeEmpty)
Sets thecanBeEmpty- Parameters:
canBeEmpty-canBeEmpty- Returns:
- the
AnnoyingFile.Optionsinstance
-
replace
@NotNull public G replace(boolean replace)
Sets thereplace- Parameters:
replace-replace- Returns:
- the
AnnoyingFile.Optionsinstance
-
-