Record Class MessageError
java.lang.Object
java.lang.Record
dev.zwazel.internal.message.data.MessageError
- Record Components:
error
- The type of error that occurred.errorMessage
- The message describing the error.
- All Implemented Interfaces:
MessageData
public record MessageError(dev.zwazel.internal.message.data.MessageError.ErrorTypes error, String errorMessage)
extends Record
implements MessageData
Represents an error message from the server.
Received when an error occurs.
-
Constructor Summary
ConstructorsConstructorDescriptionMessageError
(dev.zwazel.internal.message.data.MessageError.ErrorTypes error, String errorMessage) Creates an instance of aMessageError
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
applyOnReceive
(InternalGameWorld internalWorld) Prints the error message to the console.final boolean
Indicates whether some other object is "equal to" this one.dev.zwazel.internal.message.data.MessageError.ErrorTypes
error()
Returns the value of theerror
record component.Returns the value of theerrorMessage
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.zwazel.internal.message.MessageData
applyBeforeSend, applyOnAddingToQueue, isUnique
-
Constructor Details
-
MessageError
public MessageError(dev.zwazel.internal.message.data.MessageError.ErrorTypes error, String errorMessage) Creates an instance of aMessageError
record class.- Parameters:
error
- the value for theerror
record componenterrorMessage
- the value for theerrorMessage
record component
-
-
Method Details
-
applyOnReceive
Prints the error message to the console.- Specified by:
applyOnReceive
in interfaceMessageData
- Parameters:
internalWorld
- the world- Returns:
- true, meaning the bot can also handle this message if it wants to.
-
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)
. -
error
-
errorMessage
Returns the value of theerrorMessage
record component.- Returns:
- the value of the
errorMessage
record component
-