Record Class MachineEvents.Upgrade
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.machine.MachineEvents.Upgrade
- Record Components:
previous- how many were installed before;currenthow many now (0: removed)
- Enclosing class:
MachineEvents
public static record MachineEvents.Upgrade(@NotNull MachineInstance machine, @NotNull UpgradeType upgrade, int previous, int current)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionUpgrade(@NotNull MachineInstance machine, @NotNull UpgradeType upgrade, int previous, int current) Creates an instance of aUpgraderecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcurrent()Returns the value of thecurrentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull MachineInstancemachine()Returns the value of themachinerecord component.intprevious()Returns the value of thepreviousrecord component.final StringtoString()Returns a string representation of this record class.@NotNull UpgradeTypeupgrade()Returns the value of theupgraderecord component.
-
Constructor Details
-
Upgrade
public Upgrade(@NotNull @NotNull MachineInstance machine, @NotNull @NotNull UpgradeType upgrade, int previous, int current) Creates an instance of aUpgraderecord class.- Parameters:
machine- the value for themachinerecord componentupgrade- the value for theupgraderecord componentprevious- the value for thepreviousrecord componentcurrent- the value for thecurrentrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
machine
Returns the value of themachinerecord component.- Returns:
- the value of the
machinerecord component
-
upgrade
Returns the value of theupgraderecord component.- Returns:
- the value of the
upgraderecord component
-
previous
-
current
public int current()Returns the value of thecurrentrecord component.- Returns:
- the value of the
currentrecord component
-