Record Class CosmeticResult
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.cosmetics.CosmeticResult
- Record Components:
status- what happenedchange- the player's cosmetics of the type before and after, when storage was reached; null otherwisetransaction- the payment of a purchase, when one was attempted; null otherwisemessage- why it failed, for logs; null on success
public record CosmeticResult(@NotNull CosmeticResult.Status status, @Nullable CosmeticChange change, @Nullable CurrencyTransaction transaction, @Nullable String message)
extends Record
What became of a player's own action on a cosmetic: equipping, unequipping or buying it.
- Since:
- 1.11.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCosmeticResult(@NotNull CosmeticResult.Status status, @Nullable CosmeticChange change, @Nullable CurrencyTransaction transaction, @Nullable String message) Creates an instance of aCosmeticResultrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable CosmeticChangechange()Returns the value of thechangerecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull Optional<CosmeticChange> The change, when storage was reached.@NotNull Optional<CurrencyTransaction> The payment, when one was attempted.final inthashCode()Returns a hash code value for this object.booleanWhether it was done.@Nullable Stringmessage()Returns the value of themessagerecord component.static @NotNull CosmeticResultof(@NotNull CosmeticResult.Status status, @Nullable String message) A result that reached nothing.@NotNull CosmeticResult.Statusstatus()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.@Nullable CurrencyTransactionReturns the value of thetransactionrecord component.
-
Constructor Details
-
CosmeticResult
public CosmeticResult(@NotNull @NotNull CosmeticResult.Status status, @Nullable @Nullable CosmeticChange change, @Nullable @Nullable CurrencyTransaction transaction, @Nullable @Nullable String message) Creates an instance of aCosmeticResultrecord class.- Parameters:
status- the value for thestatusrecord componentchange- the value for thechangerecord componenttransaction- the value for thetransactionrecord componentmessage- the value for themessagerecord component
-
-
Method Details
-
of
@NotNull public static @NotNull CosmeticResult of(@NotNull @NotNull CosmeticResult.Status status, @Nullable @Nullable String message) A result that reached nothing. -
isSuccess
public boolean isSuccess()Whether it was done. -
getChange
The change, when storage was reached. -
getTransaction
The payment, when one was attempted. -
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). -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
change
Returns the value of thechangerecord component.- Returns:
- the value of the
changerecord component
-
transaction
Returns the value of thetransactionrecord component.- Returns:
- the value of the
transactionrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-