Class Win32DiskPartition

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

@ShallowImmutable public class Win32DiskPartition extends Object
Immutable representation of a Partition in a Physical disk on a Windows system.

Fields correspond to properties retrieved from the Win32_DiskPartition WMI class.

Usage examples

// Build a new instance
Win32DiskPartition partition = Win32DiskPartition.builder()
    .deviceId("Disk0\\Partition1")
    .name("System Reserved")
    .description("EFI System Partition")
    .blockSize(512L)
    .numberOfBlocks(131072L)
    .bootable(true)
    .primaryPartition(true)
    .bootPartition(true)
    .diskIndex(0)
    .size(67108864L)
    .type("EFI")
    .build();

// Create a modified copy
Win32DiskPartition resizedPartition = partition.toBuilder()
    .size(134217728L)
    .build();

See Win32DiskDrive for information about physical disks.

See Win32LogicalDisk for information about the logical volumes on a physical disk.

Since:
3.0.0
See Also:
  • Field Details

    • deviceId

      @SerializedName("DeviceID") @Nullable @Nullable String deviceId
      Unique identifier of the disk drive and partition within the system.
    • name

      @SerializedName("Name") @Nullable @Nullable String name
      Label by which the partition is known.
    • description

      @SerializedName("Description") @Nullable @Nullable String description
      Description of the partition object.
    • blockSize

      @SerializedName("BlockSize") @Nullable @Nullable BigInteger blockSize
      Size in bytes of the blocks that form this partition.
    • numberOfBlocks

      @SerializedName("NumberOfBlocks") @Nullable @Nullable BigInteger numberOfBlocks
      Total number of consecutive blocks that form this partition. The total size of the partition can be calculated by multiplying this value by blockSize.
    • bootable

      @SerializedName("Bootable") @Nullable @Nullable Boolean bootable
      Indicates whether the computer can be booted from this partition.
    • primaryPartition

      @SerializedName("PrimaryPartition") @Nullable @Nullable Boolean primaryPartition
      Indicates whether this is the primary partition on the disk.
    • bootPartition

      @SerializedName("BootPartition") @Nullable @Nullable Boolean bootPartition
      Indicates whether this is the active (boot) partition used by the operating system when booting.
    • diskIndex

      @SerializedName("DiskIndex") @Nullable @Nullable Long diskIndex
      Index number of the physical disk that contains this partition.
    • size

      @SerializedName("Size") @Nullable @Nullable BigInteger size
      Total size of the partition in bytes.
    • type

      @SerializedName("Type") @Nullable @Nullable String type
      Type of the partition

      Possible Values (Non-exhaustive, will be updated when new values are found):

      • Unused
      • 12-bit FAT
      • Xenix Type 1
      • Xenix Type 2
      • 16-bit FAT
      • Extended Partition
      • MS-DOS V4 Huge
      • Installable File System
      • PowerPC Reference Platform
      • UNIX
      • NTFS
      • ReFS
      • Win95 w/Extended Int 13
      • Extended w/Extended Int 13
      • Logical Disk Manager
      • Unknown
  • Constructor Details

    • Win32DiskPartition

      public Win32DiskPartition()
  • Method Details

    • isBootable

      @Nullable public @Nullable Boolean isBootable()
    • isPrimaryPartition

      @Nullable public @Nullable Boolean isPrimaryPartition()
    • isBootPartition

      @Nullable public @Nullable Boolean isBootPartition()
    • 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