Class Win32DiskDriveToDiskPartition

java.lang.Object
io.github.eggy03.ferrumx.windows.entity.storage.Win32DiskDriveToDiskPartition

@ShallowImmutable public class Win32DiskDriveToDiskPartition extends Object
Immutable representation of a Win32DiskDrive association with Win32DiskPartition.

Fields indirectly correspond to properties retrieved from the Win32_DiskDriveToDiskPartition WMI class and represent an association between Win32_DiskDrive and Win32_DiskPartition.

Associates Win32DiskDrive with Win32DiskPartition via their device IDs

This class has the following two fields:

Extra Notes: The Win32_DiskDriveToDiskPartition WMI class itself does not directly expose the DeviceID (from Win32_DiskDrive) or the DeviceID (from Win32_DiskPartition) as standalone properties. Instead, these values are nested within its references: Antecedent and Dependent.

To simplify data mapping, the PowerShell query defined in Cimv2.WIN32_DISK_DRIVE_TO_DISK_PARTITION constructs a custom PSObject that maps Antecedent.DeviceID to diskDriveDeviceId and Dependent.DeviceID to diskPartitionDeviceId and the resulting JSON returned is deserialized into this entity class.

Usage examples

// Build a new instance
Win32DiskDriveToDiskPartition ddt = Win32DiskDriveToDiskPartition.builder()
    .diskDriveDeviceId("////.//PHYSICALDRIVE0")
    .diskPartitionDeviceId("Disk #0 Partition #1")
    .build();
// Create a modified copy using the builder
Win32DiskDriveToDiskPartition updated = ddt.toBuilder()
    .diskPartitionDeviceId("Disk #0 Partition #2")
    .build();

See Win32DiskDrive for related physical disk info.

See Win32DiskPartition for related partitions on a physical disk.

Since:
3.0.0
See Also:
  • Field Details

    • diskDriveDeviceId

      @SerializedName("DiskDriveDeviceID") @Nullable @Nullable String diskDriveDeviceId
      Contains the deviceId field value of Win32DiskDrive
    • diskPartitionDeviceId

      @SerializedName("DiskPartitionDeviceID") @Nullable @Nullable String diskPartitionDeviceId
      Contains the deviceId field value of Win32DiskPartition
  • Constructor Details

    • Win32DiskDriveToDiskPartition

      public Win32DiskDriveToDiskPartition()
  • 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