Class Win32DiskDriveToPartitionAndLogicalDisk

java.lang.Object
io.github.eggy03.ferrumx.windows.entity.compounded.Win32DiskDriveToPartitionAndLogicalDisk

@ShallowImmutable public class Win32DiskDriveToPartitionAndLogicalDisk extends Object
Immutable representation of a Win32DiskDrive and its associated 1:N relationships with Win32DiskPartition and Win32LogicalDisk in a Windows system.

Each instance represents a single physical DiskDrive identified by deviceId, and maintains a one-to-many mapping with its corresponding DiskPartitions and LogicalDisks.

Usage example

Win32DiskDriveToPartitionAndLogicalDisk diskInfo = Win32DiskDriveToPartitionAndLogicalDisk.builder()
    .deviceId("\\\\.\\PHYSICALDRIVE0")
    .diskDrive(drive)
    .diskPartitionList(partitions)
    .logicalDiskList(logicalDisks)
    .build();

NOTE: While a DiskDrive has 1:N relationship with DiskPartitions and LogicalDisks, a single instance of a DiskPartition may also have 1:N relationship with LogicalDisks. This class does not represent such a relationship between them (Win32DiskPartition and Win32LogicalDisk) since it's primary focus is to link both of them with Win32DiskDrive. To fetch such a relation, check out the custom class Win32DiskPartitionToLogicalDisk.

This is purely a convenience class designed to help users of this library retrieve drive–partition–logical disk associations in a single function call. Using this class eliminates the need for calling the associated classes that are used to fetch an association between the DiskDrive, DiskPartition and LogicalDisk classes, namely Win32DiskDriveToDiskPartition and Win32LogicalDiskToPartition However, they will remain available for use if you prefer to map contents yourself.

NOTE: I have tried keeping this document concise, but I do realize that the one-to-many association information may feel overwhelming, which is why I would recommend checking out the documentation of the individual classes first (linked towards the end of this class documentation). Each documentation for the individual classes also has a link for the official Microsoft documentation, which I would recommend reading and experimenting with, to have a better understanding of the classes and their associations with each other.

Since:
3.0.0
See Also:
  • Field Details

    • deviceId

      @SerializedName("DeviceID") @Nullable @Nullable String deviceId
      The unique identifier for the Win32DiskDrive instance.

      This corresponds to the physical disk ID such as "\\\\.\\PHYSICALDRIVE0".

    • diskDrive

      @SerializedName("DiskDrive") @Nullable @Nullable Win32DiskDrive diskDrive
      The Win32DiskDrive entity associated with the deviceId.

      Represents the physical disk drive identified by the specified deviceId.

    • diskPartitionList

      @SerializedName("Partitions") @Nullable @Nullable List<Win32DiskPartition> diskPartitionList
      A list of Win32DiskPartition entities associated with the deviceId.

      Represents all partitions physically present on the referenced diskDrive.

    • logicalDiskList

      @SerializedName("LogicalDisks") @Nullable @Nullable List<Win32LogicalDisk> logicalDiskList
      A list of Win32LogicalDisk entities associated with the deviceId.
  • Constructor Details

    • Win32DiskDriveToPartitionAndLogicalDisk

      public Win32DiskDriveToPartitionAndLogicalDisk()
  • Method Details

    • toString

      @NotNull public @NotNull String toString()
      Retrieves the entity in a JSON pretty-print formatted string
      Overrides:
      toString in class Object
      Returns:
      the String value of the object in JSON pretty-print format