Class Win32LogicalDiskToPartition

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

@ShallowImmutable public class Win32LogicalDiskToPartition extends Object
Immutable representation of a Win32DiskPartition association with Win32LogicalDisk.

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

Associates Win32DiskPartition with Win32LogicalDisk via their device IDs

This class has the following two fields:

Extra Notes: The Win32_LogicalDiskToPartition WMI class itself does not directly expose the DeviceID (from Win32_DiskPartition) or the DeviceID (from Win32_LogicalDisk) 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_LOGICAL_DISK_TO_PARTITION constructs a custom PSObject that maps Antecedent.DeviceID to diskPartitionDeviceId and Dependent.DeviceID to logicalDiskDeviceId and the resulting JSON returned is deserialized into this entity class.

Usage examples

// Build a new instance
Win32LogicalDiskToPartition ldt = Win32LogicalDiskToPartition.builder()
    .diskPartitionDeviceId("Disk #0 Partition #1")
    .logicalDiskDeviceId("C:")
    .build();
// Create a modified copy using the builder
LWin32LogicalDiskToPartition updated = ldt.toBuilder()
    .logicalDiskDeviceId("D:")
    .build();

See Win32DiskPartition for related partitions on a physical disk.

See Win32LogicalDisk for partition info for partitions on a physical disk

Since:
3.0.0
See Also:
  • Field Details

    • diskPartitionDeviceId

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

      @SerializedName("LogicalDiskDeviceID") @Nullable @Nullable String logicalDiskDeviceId
      Contains the deviceId field value of Win32LogicalDisk
  • Constructor Details

    • Win32LogicalDiskToPartition

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