Class EmbedCache
java.lang.Object
com.github.kaktushose.jda.commands.embeds.EmbedCache
This class loads and caches embeds from a json file.
- See Also:
-
Constructor Summary
ConstructorDescriptionEmbedCache
(File file) Constructs a new EmbedCache object.EmbedCache
(InputStream stream) Constructs a new EmbedCache object.EmbedCache
(String file) Constructs a new EmbedCache object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsEmbed
(String name) Returnstrue
if this cache contains a mapping for the specified name.Gets an embed from the cache.boolean
isEmpty()
Returnstrue
if this cache contains noEmbedDTO
s.void
Loads all embeds from a file and stores them.int
size()
Returns the number ofEmbedDTO
s in this cache.values()
Returns an unmodifiable List containing allEmbedDTO
of this cache.
-
Constructor Details
-
EmbedCache
Constructs a new EmbedCache object.- Parameters:
file
- the file to load the embeds from
-
EmbedCache
Constructs a new EmbedCache object.- Parameters:
stream
- the stream to load the embeds from
-
EmbedCache
Constructs a new EmbedCache object.- Parameters:
file
- the path to the file to load the embeds from
-
-
Method Details
-
loadEmbeds
public void loadEmbeds()Loads all embeds from a file and stores them. This happens automatically each time you construct a new EmbedCache. Thus, it's not needed to call this method manually, unless you want to reload the embeds. -
getEmbed
-
isEmpty
-
size
-
containsEmbed
-
values
-