Package de.Keyle.MyPet.api.dialog
Record Class TextPromptSpec
java.lang.Object
java.lang.Record
de.Keyle.MyPet.api.dialog.TextPromptSpec
- Record Components:
title- heading shown above the prompt; empty whennullprompt- the question itself; empty whennullinitialValue- text the field starts with; empty whennullmaxLength- longest accepted input; 32 when not positive
public record TextPromptSpec(Component title, Component prompt, String initialValue, int maxLength)
extends Record
Parameters for a text-input prompt opened via
DialogService.promptText(org.bukkit.entity.Player, de.Keyle.MyPet.api.dialog.TextPromptSpec, java.util.function.Consumer<java.lang.String>, java.lang.Runnable).
The compact constructor supplies defaults so callers can pass null for
any optional field.-
Constructor Summary
ConstructorsConstructorDescriptionTextPromptSpec(Component title, Component prompt, String initialValue, int maxLength) Substitutes a default for every field left null or out of range. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinitialValuerecord component.intReturns the value of themaxLengthrecord component.prompt()Returns the value of thepromptrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TextPromptSpec
Substitutes a default for every field left null or out of range.
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
prompt
Returns the value of thepromptrecord component.- Returns:
- the value of the
promptrecord component
-
initialValue
Returns the value of theinitialValuerecord component.- Returns:
- the value of the
initialValuerecord component
-
maxLength
public int maxLength()Returns the value of themaxLengthrecord component.- Returns:
- the value of the
maxLengthrecord component
-