Record Class MachineInspection
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.machine.MachineInspection
- Record Components:
type- machine type key (for placeholders: the missing type's key)storages- contents per storage idescrow- resources in flight to other regions, still owned by this machinelockedSlots- slots holding data of unregistered resource types, per storage idunknownData- ids of persisted data this machine type no longer declares (kept verbatim)
public record MachineInspection(@NotNull net.kyori.adventure.key.Key type, @NotNull WorldPosition position, @NotNull Direction facing, boolean placeholder, @NotNull SchedulerState state, @Nullable WakeReason lastWakeReason, @Nullable MachineError lastError, @NotNull Map<String, List<StorageView>> storages, @Nullable ProcessView process, @NotNull List<InstalledUpgrade> upgrades, @NotNull List<ResourceStack> escrow, @NotNull Map<String,Integer> lockedSlots, @NotNull List<String> unknownData)
extends Record
Immutable snapshot of a machine for debugging and admin commands (ARCHITECTURE.md ยง27).
-
Constructor Summary
ConstructorsConstructorDescriptionMachineInspection(@NotNull net.kyori.adventure.key.Key type, @NotNull WorldPosition position, @NotNull Direction facing, boolean placeholder, @NotNull SchedulerState state, @Nullable WakeReason lastWakeReason, @Nullable MachineError lastError, @NotNull Map<String, List<StorageView>> storages, @Nullable ProcessView process, @NotNull List<InstalledUpgrade> upgrades, @NotNull List<ResourceStack> escrow, @NotNull Map<String, Integer> lockedSlots, @NotNull List<String> unknownData) Creates an instance of aMachineInspectionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NotNull List<ResourceStack> escrow()Returns the value of theescrowrecord component.@NotNull Directionfacing()Returns the value of thefacingrecord component.final inthashCode()Returns a hash code value for this object.@Nullable MachineErrorReturns the value of thelastErrorrecord component.@Nullable WakeReasonReturns the value of thelastWakeReasonrecord component.Returns the value of thelockedSlotsrecord component.booleanReturns the value of theplaceholderrecord component.@NotNull WorldPositionposition()Returns the value of thepositionrecord component.@Nullable ProcessViewprocess()Returns the value of theprocessrecord component.@NotNull SchedulerStatestate()Returns the value of thestaterecord component.@NotNull Map<String, List<StorageView>> storages()Returns the value of thestoragesrecord component.final StringtoString()Returns a string representation of this record class.@NotNull net.kyori.adventure.key.Keytype()Returns the value of thetyperecord component.Returns the value of theunknownDatarecord component.@NotNull List<InstalledUpgrade> upgrades()Returns the value of theupgradesrecord component.
-
Constructor Details
-
MachineInspection
public MachineInspection(@NotNull @NotNull net.kyori.adventure.key.Key type, @NotNull @NotNull WorldPosition position, @NotNull @NotNull Direction facing, boolean placeholder, @NotNull @NotNull SchedulerState state, @Nullable @Nullable WakeReason lastWakeReason, @Nullable @Nullable MachineError lastError, @NotNull @NotNull Map<String, List<StorageView>> storages, @Nullable @Nullable ProcessView process, @NotNull @NotNull List<InstalledUpgrade> upgrades, @NotNull @NotNull List<ResourceStack> escrow, @NotNull @NotNull Map<String, Integer> lockedSlots, @NotNull @NotNull List<String> unknownData) Creates an instance of aMachineInspectionrecord class.- Parameters:
type- the value for thetyperecord componentposition- the value for thepositionrecord componentfacing- the value for thefacingrecord componentplaceholder- the value for theplaceholderrecord componentstate- the value for thestaterecord componentlastWakeReason- the value for thelastWakeReasonrecord componentlastError- the value for thelastErrorrecord componentstorages- the value for thestoragesrecord componentprocess- the value for theprocessrecord componentupgrades- the value for theupgradesrecord componentescrow- the value for theescrowrecord componentlockedSlots- the value for thelockedSlotsrecord componentunknownData- the value for theunknownDatarecord 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. -
type
-
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
facing
Returns the value of thefacingrecord component.- Returns:
- the value of the
facingrecord component
-
placeholder
public boolean placeholder()Returns the value of theplaceholderrecord component.- Returns:
- the value of the
placeholderrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
lastWakeReason
Returns the value of thelastWakeReasonrecord component.- Returns:
- the value of the
lastWakeReasonrecord component
-
lastError
Returns the value of thelastErrorrecord component.- Returns:
- the value of the
lastErrorrecord component
-
storages
-
process
Returns the value of theprocessrecord component.- Returns:
- the value of the
processrecord component
-
upgrades
Returns the value of theupgradesrecord component.- Returns:
- the value of the
upgradesrecord component
-
escrow
-
lockedSlots
Returns the value of thelockedSlotsrecord component.- Returns:
- the value of the
lockedSlotsrecord component
-
unknownData
Returns the value of theunknownDatarecord component.- Returns:
- the value of the
unknownDatarecord component
-