Record Class MessageTranslations

java.lang.Object
java.lang.Record
net.jeqo.bloons.message.MessageTranslations
Record Components:
instance - The instance of the plugin, type org.bukkit.plugin.java.JavaPlugin

public record MessageTranslations(org.bukkit.plugin.java.JavaPlugin instance) extends Record
A utility class intended to get messages from the config.yml file
  • Constructor Summary

    Constructors
    Constructor
    Description
    MessageTranslations(org.bukkit.plugin.java.JavaPlugin instance)
    Creates an instance of a MessageTranslations record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    getInt(String path)
    Get an integer from the config.yml file
    net.kyori.adventure.text.Component
    Converts a message containing MiniMessage serialized strings to a Component that can be used to send formatted messages with gradients, rainbows, etc.
    net.kyori.adventure.text.Component
    getSerializedString(String messagePrefix, String messageSuffix)
    Converts a message containing MiniMessage serialized strings to a Component that can be used to send formatted messages with gradients, rainbows, etc.
    Get a string from the config.yml file
    final int
    Returns a hash code value for this object.
    org.bukkit.plugin.java.JavaPlugin
    Returns the value of the instance record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MessageTranslations

      public MessageTranslations(org.bukkit.plugin.java.JavaPlugin instance)
      Creates an instance of a MessageTranslations record class.
      Parameters:
      instance - the value for the instance record component
  • Method Details

    • getSerializedString

      public net.kyori.adventure.text.Component getSerializedString(String messagePrefix, String messageSuffix)
      Converts a message containing MiniMessage serialized strings to a Component that can be used to send formatted messages with gradients, rainbows, etc.
      Parameters:
      messagePrefix - The prefix of the message, type java.lang.String
      messageSuffix - The suffix of the message, type java.lang.String
      Returns:
      The formatted message as a Component, type net.kyori.adventure.text.Component
    • getSerializedString

      public net.kyori.adventure.text.Component getSerializedString(String message)
      Converts a message containing MiniMessage serialized strings to a Component that can be used to send formatted messages with gradients, rainbows, etc.
      Parameters:
      message - The message to convert to a deserialized component, type java.lang.String
      Returns:
      The formatted message as a Component, type net.kyori.adventure.text.Component
    • getString

      public String getString(String path)
      Get a string from the config.yml file
      Parameters:
      path - The path to the string, type java.lang.String
      Returns:
      The value at the specified path, type java.lang.String
    • getInt

      public Integer getInt(String path)
      Get an integer from the config.yml file
      Parameters:
      path - The path to the integer, type java.lang.String
      Returns:
      The value at the specified path, type java.lang.Integer
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • instance

      public org.bukkit.plugin.java.JavaPlugin instance()
      Returns the value of the instance record component.
      Returns:
      the value of the instance record component