Record Class ConfigurationScreen.ConfigurationSectionScreen.Element

java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.gui.ConfigurationScreen.ConfigurationSectionScreen.Element
Enclosing class:
ConfigurationScreen.ConfigurationSectionScreen

public static record ConfigurationScreen.ConfigurationSectionScreen.Element(@Nullable Component name, @Nullable Component tooltip, @Nullable AbstractWidget widget, @Nullable OptionInstance<?> option, boolean undoable) extends Record
  • Field Details

    • name

      @Nullable private final @Nullable Component name
      The field for the name record component.
    • tooltip

      @Nullable private final @Nullable Component tooltip
      The field for the tooltip record component.
    • widget

      @Nullable private final @Nullable AbstractWidget widget
      The field for the widget record component.
    • option

      @Nullable private final @Nullable OptionInstance<?> option
      The field for the option record component.
    • undoable

      private final boolean undoable
      The field for the undoable record component.
  • Constructor Details

    • Element

      @Internal public Element(@Nullable @Nullable Component name, @Nullable @Nullable Component tooltip, @Nullable @Nullable AbstractWidget widget, @Nullable @Nullable OptionInstance<?> option, boolean undoable)
      Creates an instance of a Element record class.
      Parameters:
      name - the value for the name record component
      tooltip - the value for the tooltip record component
      widget - the value for the widget record component
      option - the value for the option record component
      undoable - the value for the undoable record component
    • Element

      public Element(@Nullable @Nullable Component name, @Nullable @Nullable Component tooltip, AbstractWidget widget)
    • Element

      public Element(@Nullable @Nullable Component name, @Nullable @Nullable Component tooltip, AbstractWidget widget, boolean undoable)
    • Element

      public Element(Component name, Component tooltip, OptionInstance<?> option)
    • Element

      public Element(Component name, Component tooltip, OptionInstance<?> option, boolean undoable)
  • Method Details

    • getWidget

      public AbstractWidget getWidget(Options options)
    • any

      @Nullable public @Nullable Object any()
    • 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 Component name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • tooltip

      @Nullable public @Nullable Component tooltip()
      Returns the value of the tooltip record component.
      Returns:
      the value of the tooltip record component
    • widget

      @Nullable public @Nullable AbstractWidget widget()
      Returns the value of the widget record component.
      Returns:
      the value of the widget record component
    • option

      @Nullable public @Nullable OptionInstance<?> option()
      Returns the value of the option record component.
      Returns:
      the value of the option record component
    • undoable

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