Record Class Currency

java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.economy.Currency

public record Currency(net.kyori.adventure.key.Key id, net.kyori.adventure.text.Component name, net.kyori.adventure.text.Component pluralName, net.kyori.adventure.text.Component symbol, int fractionalDigits, boolean isPrefix, BigDecimal minBalance, BigDecimal maxBalance) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    Currency(net.kyori.adventure.key.Key id, net.kyori.adventure.text.Component name, net.kyori.adventure.text.Component pluralName, net.kyori.adventure.text.Component symbol, int fractionalDigits, boolean isPrefix, BigDecimal minBalance, BigDecimal maxBalance)
    Creates an instance of a Currency record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.kyori.adventure.text.Component
     
    net.kyori.adventure.text.Component
     
     
    int
    Returns the value of the fractionalDigits record component.
    final int
    Returns a hash code value for this object.
    net.kyori.adventure.key.Key
    id()
    Returns the value of the id record component.
    boolean
    Returns the value of the isPrefix record component.
    Returns the value of the maxBalance record component.
    Returns the value of the minBalance record component.
    net.kyori.adventure.text.Component
    Returns the value of the name record component.
    net.kyori.adventure.text.Component
    Returns the value of the pluralName record component.
    net.kyori.adventure.text.Component
    Returns the value of the symbol record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • Currency

      public Currency(net.kyori.adventure.key.Key id, net.kyori.adventure.text.Component name, net.kyori.adventure.text.Component pluralName, net.kyori.adventure.text.Component symbol, int fractionalDigits, boolean isPrefix, BigDecimal minBalance, BigDecimal maxBalance)
      Creates an instance of a Currency record class.
      Parameters:
      id - the value for the id record component
      name - the value for the name record component
      pluralName - the value for the pluralName record component
      symbol - the value for the symbol record component
      fractionalDigits - the value for the fractionalDigits record component
      isPrefix - the value for the isPrefix record component
      minBalance - the value for the minBalance record component
      maxBalance - the value for the maxBalance record component
  • Method Details

    • formatValue

      public BigDecimal formatValue(BigDecimal amount)
    • format

      public net.kyori.adventure.text.Component format(BigDecimal amount)
    • formatName

      public net.kyori.adventure.text.Component formatName(BigDecimal amount)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • id

      public net.kyori.adventure.key.Key id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public net.kyori.adventure.text.Component name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • pluralName

      public net.kyori.adventure.text.Component pluralName()
      Returns the value of the pluralName record component.
      Returns:
      the value of the pluralName record component
    • symbol

      public net.kyori.adventure.text.Component symbol()
      Returns the value of the symbol record component.
      Returns:
      the value of the symbol record component
    • fractionalDigits

      public int fractionalDigits()
      Returns the value of the fractionalDigits record component.
      Returns:
      the value of the fractionalDigits record component
    • isPrefix

      public boolean isPrefix()
      Returns the value of the isPrefix record component.
      Returns:
      the value of the isPrefix record component
    • minBalance

      public BigDecimal minBalance()
      Returns the value of the minBalance record component.
      Returns:
      the value of the minBalance record component
    • maxBalance

      public BigDecimal maxBalance()
      Returns the value of the maxBalance record component.
      Returns:
      the value of the maxBalance record component