Record Class ActionResult
java.lang.Object
java.lang.Record
dev.yowsef.stealablock.api.result.ActionResult
public record ActionResult(@NotNull ActionResult.Status status, @Nullable String reason)
extends Record
Outcome of a gameplay or storage action invoked via the API.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionActionResult(@NotNull ActionResult.Status status, @Nullable String reason) Creates an instance of aActionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static @NotNull ActionResultfail(@NotNull ActionResult.Status status, @Nullable String reason) final inthashCode()Returns a hash code value for this object.static @NotNull ActionResultok()@Nullable Stringreason()Returns the value of thereasonrecord component.@NotNull ActionResult.Statusstatus()Returns the value of thestatusrecord component.booleansuccess()final StringtoString()Returns a string representation of this record class.
-
Field Details
-
SUCCESS
-
-
Constructor Details
-
ActionResult
public ActionResult(@NotNull @NotNull ActionResult.Status status, @Nullable @Nullable String reason) Creates an instance of aActionResultrecord class.- Parameters:
status- the value for thestatusrecord componentreason- the value for thereasonrecord component
-
-
Method Details
-
success
public boolean success() -
ok
-
fail
@NotNull public static @NotNull ActionResult fail(@NotNull @NotNull ActionResult.Status status, @Nullable @Nullable String reason) -
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). -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-