Record Class Font.OffsetGlyph

java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.resource.asset.Font.OffsetGlyph
Record Components:
fontId - The key identifier of the font.
character - The unicode character.
advance - The pixel advance distance.
All Implemented Interfaces:
Font.Glyph
Enclosing class:
Font

public static record Font.OffsetGlyph(net.kyori.adventure.key.Key fontId, char character, int advance) extends Record implements Font.Glyph
A spacing glyph that adjusts character advance.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OffsetGlyph(net.kyori.adventure.key.Key fontId, char character, int advance)
    Creates an instance of a OffsetGlyph record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the advance record component.
    char
    Returns the value of the character record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.kyori.adventure.key.Key
    Returns the value of the fontId record component.
    final int
    Returns a hash code value for this object.
    net.kyori.adventure.text.TextComponent
    Converts this offset glyph to a TextComponent.
    Converts this offset glyph to a MiniMessage string format.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • OffsetGlyph

      public OffsetGlyph(net.kyori.adventure.key.Key fontId, char character, int advance)
      Creates an instance of a OffsetGlyph record class.
      Parameters:
      fontId - the value for the fontId record component
      character - the value for the character record component
      advance - the value for the advance record component
  • Method Details

    • toComponent

      public net.kyori.adventure.text.TextComponent toComponent()
      Converts this offset glyph to a TextComponent.
      Returns:
      The representing TextComponent.
    • toMiniMessageString

      public String toMiniMessageString()
      Converts this offset glyph to a MiniMessage string format.
      Returns:
      The formatted MiniMessage string.
    • 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.
    • fontId

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

      public char character()
      Returns the value of the character record component.
      Returns:
      the value of the character record component
    • advance

      public int advance()
      Returns the value of the advance record component.
      Returns:
      the value of the advance record component