Record Class BotOperationResult
java.lang.Object
java.lang.Record
com.monkey.ultimatebot.api.model.runtime.BotOperationResult
- Record Components:
success-truewhen the operation completed successfullymessage- human-readable operation message (success or failure reason)snapshot- optional bot snapshot associated with the operation
public record BotOperationResult(boolean success, String message, @Nullable BotSnapshot snapshot)
extends Record
Standard result object for bot operations.
-
Constructor Summary
ConstructorsConstructorDescriptionBotOperationResult(boolean success, String message, @Nullable BotSnapshot snapshot) Creates an instance of aBotOperationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static BotOperationResultCreates a failed operation result.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.@Nullable BotSnapshotsnapshot()Returns the value of thesnapshotrecord component.Returns snapshot as an optional.booleansuccess()Returns the value of thesuccessrecord component.static BotOperationResultsuccess(String message, @Nullable BotSnapshot snapshot) Creates a successful operation result.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
success
Creates a successful operation result.- Parameters:
message- success messagesnapshot- bot snapshot after operation, may benull- Returns:
- success result
-
failure
Creates a failed operation result.- Parameters:
message- failure reason- Returns:
- failure result
-
snapshotOptional
Returns snapshot as an optional.- Returns:
- optional snapshot
-
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 '=='. -
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
snapshot
Returns the value of thesnapshotrecord component.- Returns:
- the value of the
snapshotrecord component
-