Record Class QuestionAnswerType<T>
java.lang.Object
java.lang.Record
eu.cloudnetservice.node.impl.console.animation.setup.answer.QuestionAnswerType<T>
public record QuestionAnswerType<T>(@NonNull QuestionAnswerType.Parser<T> parser, @Nullable String recommendation, @NonNull Supplier<Collection<String>> possibleResults, @NonNull Collection<BiConsumer<QuestionAnswerType<T>, T>> resultListener, @NonNull BiFunction<QuestionAnswerType<?>, String, String> invalidInputSupplier)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BiFunction<QuestionAnswerType<?>, String, String> private final @NonNull BiFunction<QuestionAnswerType<?>, String, String> The field for theinvalidInputSupplierrecord component.private final @NonNull QuestionAnswerType.Parser<T> The field for theparserrecord component.private final @NonNull Supplier<Collection<String>> The field for thepossibleResultsrecord component.The field for therecommendationrecord component.private final @NonNull Collection<BiConsumer<QuestionAnswerType<T>, T>> The field for theresultListenerrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionQuestionAnswerType(@NonNull QuestionAnswerType.Parser<T> parser, @Nullable String recommendation, @NonNull Supplier<Collection<String>> possibleResults, @NonNull Collection<BiConsumer<QuestionAnswerType<T>, T>> resultListener, @NonNull BiFunction<QuestionAnswerType<?>, String, String> invalidInputSupplier) Creates an instance of aQuestionAnswerTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NonNull QuestionAnswerType.Builder<T> builder()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.invalidInputMessage(@NonNull String inputLine) Returns the value of theinvalidInputSupplierrecord component.parser()Returns the value of theparserrecord component.Returns the value of thepossibleResultsrecord component.voidpostResult(@Nullable Object result) Returns the value of therecommendationrecord component.Returns the value of theresultListenerrecord component.voidthenAccept(@NonNull BiConsumer<QuestionAnswerType<T>, T> listener) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
parser
The field for theparserrecord component. -
recommendation
-
possibleResults
The field for thepossibleResultsrecord component. -
resultListener
The field for theresultListenerrecord component. -
invalidInputSupplier
@NonNull private final @NonNull BiFunction<QuestionAnswerType<?>, String, String> invalidInputSupplierThe field for theinvalidInputSupplierrecord component. -
DEFAULT_INVALID_SUPPLIER
-
-
Constructor Details
-
QuestionAnswerType
public QuestionAnswerType(@NonNull @NonNull QuestionAnswerType.Parser<T> parser, @Nullable @Nullable String recommendation, @NonNull @NonNull Supplier<Collection<String>> possibleResults, @NonNull @NonNull Collection<BiConsumer<QuestionAnswerType<T>, T>> resultListener, @NonNull @NonNull BiFunction<QuestionAnswerType<?>, String, String> invalidInputSupplier) Creates an instance of aQuestionAnswerTyperecord class.- Parameters:
parser- the value for theparserrecord componentrecommendation- the value for therecommendationrecord componentpossibleResults- the value for thepossibleResultsrecord componentresultListener- the value for theresultListenerrecord componentinvalidInputSupplier- the value for theinvalidInputSupplierrecord component
-
-
Method Details
-
builder
-
possibleAnswers
-
invalidInputMessage
-
tryParse
-
postResult
-
thenAccept
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
parser
Returns the value of theparserrecord component.- Returns:
- the value of the
parserrecord component
-
recommendation
-
possibleResults
Returns the value of thepossibleResultsrecord component.- Returns:
- the value of the
possibleResultsrecord component
-
resultListener
Returns the value of theresultListenerrecord component.- Returns:
- the value of the
resultListenerrecord component
-
invalidInputSupplier
Returns the value of theinvalidInputSupplierrecord component.- Returns:
- the value of the
invalidInputSupplierrecord component
-