Record Class Font.TextureGlyph

java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.resource.asset.Font.TextureGlyph
Record Components:
name - The name of the glyph used for tag resolution, or null if unnamed.
fontId - The key identifier of the font.
texture - The texture used by the glyph.
character - The unicode character.
height - The pixel height.
ascent - The pixel ascent.
All Implemented Interfaces:
Font.Glyph
Enclosing class:
Font

public static record Font.TextureGlyph(@Nullable String name, net.kyori.adventure.key.Key fontId, @NotNull Texture texture, char character, int height, int ascent) extends Record implements Font.Glyph
A glyph from a bitmap texture.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TextureGlyph(@Nullable String name, net.kyori.adventure.key.Key fontId, @NotNull Texture texture, char character, int height, int ascent)
    Creates an instance of a TextureGlyph record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the ascent 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.
    int
    Returns the value of the height record component.
    @Nullable String
    Returns the value of the name record component.
    @NotNull Texture
    Returns the value of the texture record component.
    net.kyori.adventure.text.TextComponent
    Converts this glyph to a TextComponent.
    Converts this 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

    • TextureGlyph

      public TextureGlyph(@Nullable @Nullable String name, net.kyori.adventure.key.Key fontId, @NotNull @NotNull Texture texture, char character, int height, int ascent)
      Creates an instance of a TextureGlyph record class.
      Parameters:
      name - the value for the name record component
      fontId - the value for the fontId record component
      texture - the value for the texture record component
      character - the value for the character record component
      height - the value for the height record component
      ascent - the value for the ascent record component
  • Method Details

    • toComponent

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

      public String toMiniMessageString()
      Converts this 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.
    • name

      @Nullable public @Nullable String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • fontId

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

      @NotNull public @NotNull Texture texture()
      Returns the value of the texture record component.
      Returns:
      the value of the texture record component
    • character

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

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • ascent

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