Record Class FoliosEntry.Listing

java.lang.Object
java.lang.Record
net.ixdarklord.folios.api.client.FoliosEntry.Listing
Record Components:
name - raw, as written; null to take its title, else the name of the item it shows, else its entry's
icon - its own; null to take the item it shows, else its entry's icon
page - which page of the entry it is (from 0)
element - which element of that page it is (from 0), or -1 for the page itself
title - its title as written, or null
shown - what it shows: its items and its words
locks - what keeps it closed besides its entry: its page's lock, and its own as an element
Enclosing class:
FoliosEntry

public static record FoliosEntry.Listing(@Nullable String name, @Nullable FoliosIcon icon, int page, int element, @Nullable String title, FoliosPageElement shown, List<FoliosLock> locks) extends Record
A page of the entry, or an element of one, written with "index": listed in the book's index and found by its search as an entry is, under a name and an icon of its own, and opening the entry at it. In JSON, "index": true, or "index": {"name": ..., "icon": ...} to name it and give it an icon.
  • Constructor Details

    • Listing

      public Listing(@Nullable @Nullable String name, @Nullable @Nullable FoliosIcon icon, int page, int element, @Nullable @Nullable String title, FoliosPageElement shown, List<FoliosLock> locks)
      Creates an instance of a Listing record class.
      Parameters:
      name - the value for the name record component
      icon - the value for the icon record component
      page - the value for the page record component
      element - the value for the element record component
      title - the value for the title record component
      shown - the value for the shown record component
      locks - the value for the locks record component
  • Method Details

    • title

      public net.minecraft.network.chat.Component title(FoliosEntry entry)
      What it is listed as.
    • icon

      public FoliosIcon icon(FoliosEntry entry)
      The icon it is listed with.
    • link

      public String link(FoliosEntry entry)
      Where it is, as a link: entry:<id>#@<page> for a page, entry:<id>#@<page>.<element> for an element.
    • isOpen

      public boolean isOpen(FoliosEntry entry)
      Whether it can be read: its entry open, and nothing of its own keeping it closed.
    • isVisible

      public boolean isVisible(FoliosEntry entry)
      Whether it is listed at all: it and its entry not secret, or open.
    • 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 '=='.
      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
    • icon

      @Nullable public @Nullable FoliosIcon icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • page

      public int page()
      Returns the value of the page record component.
      Returns:
      the value of the page record component
    • element

      public int element()
      Returns the value of the element record component.
      Returns:
      the value of the element record component
    • title

      @Nullable public @Nullable String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • shown

      public FoliosPageElement shown()
      Returns the value of the shown record component.
      Returns:
      the value of the shown record component
    • locks

      public List<FoliosLock> locks()
      Returns the value of the locks record component.
      Returns:
      the value of the locks record component