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 id
escrow - resources in flight to other regions, still owned by this machine
lockedSlots - slots holding data of unregistered resource types, per storage id
unknownData - 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 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 a MachineInspection record class.
      Parameters:
      type - the value for the type record component
      position - the value for the position record component
      facing - the value for the facing record component
      placeholder - the value for the placeholder record component
      state - the value for the state record component
      lastWakeReason - the value for the lastWakeReason record component
      lastError - the value for the lastError record component
      storages - the value for the storages record component
      process - the value for the process record component
      upgrades - the value for the upgrades record component
      escrow - the value for the escrow record component
      lockedSlots - the value for the lockedSlots record component
      unknownData - the value for the unknownData record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      @NotNull public @NotNull net.kyori.adventure.key.Key type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • position

      @NotNull public @NotNull WorldPosition position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • facing

      @NotNull public @NotNull Direction facing()
      Returns the value of the facing record component.
      Returns:
      the value of the facing record component
    • placeholder

      public boolean placeholder()
      Returns the value of the placeholder record component.
      Returns:
      the value of the placeholder record component
    • state

      @NotNull public @NotNull SchedulerState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • lastWakeReason

      @Nullable public @Nullable WakeReason lastWakeReason()
      Returns the value of the lastWakeReason record component.
      Returns:
      the value of the lastWakeReason record component
    • lastError

      @Nullable public @Nullable MachineError lastError()
      Returns the value of the lastError record component.
      Returns:
      the value of the lastError record component
    • storages

      @NotNull public @NotNull Map<String, List<StorageView>> storages()
      Returns the value of the storages record component.
      Returns:
      the value of the storages record component
    • process

      @Nullable public @Nullable ProcessView process()
      Returns the value of the process record component.
      Returns:
      the value of the process record component
    • upgrades

      @NotNull public @NotNull List<InstalledUpgrade> upgrades()
      Returns the value of the upgrades record component.
      Returns:
      the value of the upgrades record component
    • escrow

      @NotNull public @NotNull List<ResourceStack> escrow()
      Returns the value of the escrow record component.
      Returns:
      the value of the escrow record component
    • lockedSlots

      @NotNull public @NotNull Map<String,Integer> lockedSlots()
      Returns the value of the lockedSlots record component.
      Returns:
      the value of the lockedSlots record component
    • unknownData

      @NotNull public @NotNull List<String> unknownData()
      Returns the value of the unknownData record component.
      Returns:
      the value of the unknownData record component