Class Win32NetworkAdapterSetting

java.lang.Object
io.github.eggy03.ferrumx.windows.entity.network.Win32NetworkAdapterSetting

@ShallowImmutable public class Win32NetworkAdapterSetting extends Object
Immutable representation of the association between a Win32NetworkAdapter and it's Win32NetworkAdapterConfiguration.

Fields indirectly correspond to properties retrieved from the Win32_NetworkAdapterSetting WMI class and represent an association between Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration.

Links Win32NetworkAdapter with Win32NetworkAdapterConfiguration via their device IDs and indexes respectively

This class has the following two fields:

Extra Notes: The Win32_NetworkAdapterSetting WMI class itself does not directly expose the DeviceID (from Win32_NetworkAdapter) or the Index (from Win32_NetworkAdapterConfiguration) as standalone properties. Instead, these values are nested within its references: Element and Setting, respectively.

To simplify data mapping, the PowerShell query defined in Cimv2.WIN32_NETWORK_ADAPTER_SETTING constructs a custom PSObject that maps Element.DeviceID to networkAdapterDeviceId and Setting.Index to networkAdapterConfigurationIndex and the resulting JSON returned is deserialized into this entity class.

Usage examples

// Build a new NetworkAdapterSetting instance
Win32NetworkAdapterSetting nas = Win32NetworkAdapterSetting.builder()
    .networkAdapterDeviceId("1")
    .networkAdapterConfigurationIndex(1)
    .build();

// Create a modified copy using the builder
Win32NetworkAdapterSetting updated = nas.toBuilder()
    .networkAdapterConfigurationIndex(2)
    .build();

See Win32NetworkAdapter for adapter info.

See Win32NetworkAdapterConfiguration for related adapter config info.

Since:
3.0.0
See Also:
  • Field Details

    • networkAdapterDeviceId

      @SerializedName("NetworkAdapterDeviceID") @Nullable @Nullable String networkAdapterDeviceId
      The deviceId field value of Win32NetworkAdapter
    • networkAdapterConfigurationIndex

      @SerializedName("NetworkAdapterConfigurationIndex") @Nullable @Nullable Integer networkAdapterConfigurationIndex
      The index field value of Win32NetworkAdapterConfiguration
  • Constructor Details

    • Win32NetworkAdapterSetting

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