Package com.ohacd.matchbox.api
Record Class ChatProcessor.ChatProcessingResult
java.lang.Object
java.lang.Record
com.ohacd.matchbox.api.ChatProcessor.ChatProcessingResult
- Record Components:
result- the processing result enummessage- the (possibly modified) message
- Enclosing interface:
ChatProcessor
public static record ChatProcessor.ChatProcessingResult(@NotNull ChatResult result, @NotNull ChatMessage message)
extends Record
Result of chat processing with optional modified message.
-
Constructor Summary
ConstructorsConstructorDescriptionChatProcessingResult(@NotNull ChatResult result, @NotNull ChatMessage message) Creates an instance of aChatProcessingResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionallow(@NotNull ChatMessage message) Creates an ALLOW result with the original message.allowModified(@NotNull ChatMessage modifiedMessage) Creates an ALLOW result with a modified message.cancel(@NotNull ChatMessage message) Creates a CANCEL result.deny(@NotNull ChatMessage message) Creates a DENY result.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull ChatMessagemessage()Returns the value of themessagerecord component.@NotNull ChatResultresult()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ChatProcessingResult
public ChatProcessingResult(@NotNull @NotNull ChatResult result, @NotNull @NotNull ChatMessage message) Creates an instance of aChatProcessingResultrecord class.
-
-
Method Details
-
allow
Creates an ALLOW result with the original message.- Parameters:
message- original chat message- Returns:
- a ChatProcessingResult indicating ALLOW with the provided message
-
allowModified
public static ChatProcessor.ChatProcessingResult allowModified(@NotNull @NotNull ChatMessage modifiedMessage) Creates an ALLOW result with a modified message.- Parameters:
modifiedMessage- modified chat message- Returns:
- a ChatProcessingResult indicating ALLOW with the modified message
-
deny
Creates a DENY result.- Parameters:
message- original chat message- Returns:
- a ChatProcessingResult indicating DENY
-
cancel
Creates a CANCEL result.- Parameters:
message- original chat message- Returns:
- a ChatProcessingResult indicating CANCEL
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-