Package de.marcely.bedwars.api.message
Class DefaultMessageMappings
java.lang.Object
de.marcely.bedwars.api.message.DefaultMessageMappings
Contains a collection of messages that'll be used when the user tries to obtain a message from his messages file that is however not present.
This class is helpful for plugins that want to retain the users ability to customize the message.
You may directly link it to your internal messages.yml file making it easier using loadInternalYAML(Plugin, InputStream)
.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
Returns the plugin that has constructed this instance.boolean
isEmpty()
keySet()
static DefaultMessageMappings
loadInternalYAML
(Plugin plugin, InputStream stream) Tries to load the YAML file as a language file.@Nullable String
void
int
size()
@NotNull Collection
<String> values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
DefaultMessageMappings
-
-
Method Details
-
getPlugin
Returns the plugin that has constructed this instance.- Returns:
- The plugin behind these mappings
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<String,
String>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
String>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
loadInternalYAML
public static DefaultMessageMappings loadInternalYAML(Plugin plugin, InputStream stream) throws IOException Tries to load the YAML file as a language file.Automatically closes the stream.
- Parameters:
plugin
- The plugin that wants them to get readstream
- The stream from which shall be read- Returns:
- The read mappings
- Throws:
IOException
- Might fail to load it
-