Class InputPattern.Builder
java.lang.Object
com.pixelmonmod.pixelmon.api.dialogue.InputPattern.Builder
- Enclosing class:
- InputPattern
A builder for the
InputPattern
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionanyInput()
Sets the regex to accept any input at all (including none).build()
Creates theInputPattern
from the builder.errorDuration
(long errorDuration) The duration in milliseconds that the error message will display in the display box.errorDuration
(TimeUnit unit, long duration) The duration that the error message will display in the display box.errorMessage
(String errorMessage) The error message to display when the input is invalid.errorMessage
(net.minecraft.network.chat.Component errorMessage) The error message to display when the input is invalid.Sets the regex to accept any input at all as long as it is not empty.Sets the regex to only accept inputs that are only alphabetical characters and spaces.Sets the regex to only accept inputs that are entirely alphabetical characters.Sets the regex to only accept inputs that are only alphabetical characters, spaces, and numbers.Sets the regex to only accept inputs that are entirely numerical characters.validURL()
Sets the regex to accept only valid URLs.
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
pattern
-
pattern
-
onlyIntegerInput
Sets the regex to only accept inputs that are entirely numerical characters.- Returns:
- This builder.
-
onlyAlphabeticalInput
Sets the regex to only accept inputs that are entirely alphabetical characters.- Returns:
- This builder.
-
onlyAlphabeticalAndSpaceInput
Sets the regex to only accept inputs that are only alphabetical characters and spaces.- Returns:
- This builder.
-
onlyAlphaNumericInput
Sets the regex to only accept inputs that are only alphabetical characters, spaces, and numbers.- Returns:
- This builder.
-
anyInput
Sets the regex to accept any input at all (including none).- Returns:
- This builder.
-
nonEmptyInput
Sets the regex to accept any input at all as long as it is not empty.- Returns:
- This builder.
-
validURL
Sets the regex to accept only valid URLs.- Returns:
- This builder.
-
errorMessage
The error message to display when the input is invalid.- Parameters:
errorMessage
- The error message.- Returns:
- This builder.
-
errorMessage
The error message to display when the input is invalid.- Parameters:
errorMessage
- The error message.- Returns:
- This builder.
-
errorDuration
The duration that the error message will display in the display box.- Parameters:
unit
- The unit of time.duration
- The duration.- Returns:
- This builder.
-
errorDuration
The duration in milliseconds that the error message will display in the display box.- Parameters:
errorDuration
- The duration in milliseconds.- Returns:
- This builder.
-
build
Creates theInputPattern
from the builder.- Returns:
- The
InputPattern
.
-