Record Class BooleanInput

java.lang.Object
java.lang.Record
net.minecraft.server.dialog.input.BooleanInput
All Implemented Interfaces:
InputControl

public record BooleanInput(Component label, boolean initial, String onTrue, String onFalse) extends Record implements InputControl
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final boolean
    The field for the initial record component.
    private final Component
    The field for the label record component.
    static final com.mojang.serialization.MapCodec<BooleanInput>
     
    private final String
    The field for the onFalse record component.
    private final String
    The field for the onTrue record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BooleanInput(Component label, boolean initial, String onTrue, String onFalse)
    Creates an instance of a BooleanInput 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 initial record component.
    Returns the value of the label record component.
    com.mojang.serialization.MapCodec<BooleanInput>
     
    Returns the value of the onFalse record component.
    Returns the value of the onTrue record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • label

      private final Component label
      The field for the label record component.
    • initial

      private final boolean initial
      The field for the initial record component.
    • onTrue

      private final String onTrue
      The field for the onTrue record component.
    • onFalse

      private final String onFalse
      The field for the onFalse record component.
    • MAP_CODEC

      public static final com.mojang.serialization.MapCodec<BooleanInput> MAP_CODEC
  • Constructor Details

    • BooleanInput

      public BooleanInput(Component label, boolean initial, String onTrue, String onFalse)
      Creates an instance of a BooleanInput record class.
      Parameters:
      label - the value for the label record component
      initial - the value for the initial record component
      onTrue - the value for the onTrue record component
      onFalse - the value for the onFalse record component
  • Method Details

    • mapCodec

      public com.mojang.serialization.MapCodec<BooleanInput> mapCodec()
      Specified by:
      mapCodec in interface InputControl
    • 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.
    • label

      public Component label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • initial

      public boolean initial()
      Returns the value of the initial record component.
      Returns:
      the value of the initial record component
    • onTrue

      public String onTrue()
      Returns the value of the onTrue record component.
      Returns:
      the value of the onTrue record component
    • onFalse

      public String onFalse()
      Returns the value of the onFalse record component.
      Returns:
      the value of the onFalse record component