Record Class FormattingContext

java.lang.Object
java.lang.Record
com.blamejared.searchables.api.formatter.FormattingContext
Record Components:
isKey - Is the current expression a key
style - The style to apply to the current expression
valid - If the current expression is valid.

public record FormattingContext(boolean isKey, net.minecraft.network.chat.Style style, boolean valid) extends Record
Extra context used by the FormattingVisitor.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FormattingContext(boolean isKey, net.minecraft.network.chat.Style style, boolean valid)
    Creates an instance of a FormattingContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the isKey record component.
    key(net.minecraft.network.chat.Style validStyle, boolean valid)
     
    literal(net.minecraft.network.chat.Style validStyle, boolean valid)
     
    net.minecraft.network.chat.Style
    Returns the value of the style record component.
    net.minecraft.network.chat.Style
    style(boolean valid)
     
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the valid record component.

    Methods inherited from class java.lang.Object

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

    • FormattingContext

      public FormattingContext(boolean isKey, net.minecraft.network.chat.Style style, boolean valid)
      Creates an instance of a FormattingContext record class.
      Parameters:
      isKey - the value for the isKey record component
      style - the value for the style record component
      valid - the value for the valid record component
  • Method Details

    • empty

      public static FormattingContext empty()
    • key

      public static FormattingContext key(net.minecraft.network.chat.Style validStyle, boolean valid)
    • literal

      public static FormattingContext literal(net.minecraft.network.chat.Style validStyle, boolean valid)
    • style

      public net.minecraft.network.chat.Style style(boolean valid)
    • 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.
    • isKey

      public boolean isKey()
      Returns the value of the isKey record component.
      Returns:
      the value of the isKey record component
    • style

      public net.minecraft.network.chat.Style style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component
    • valid

      public boolean valid()
      Returns the value of the valid record component.
      Returns:
      the value of the valid record component