Class WmiUtilFFM

java.lang.Object
oshi.util.platform.windows.WmiUtilFFM

@ThreadSafe public final class WmiUtilFFM extends Object
Helper class for WMI using FFM-based WmiResult.
  • Method Details

    • getString

      public static <T extends Enum<T>> String getString(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a String value from a WmiResult.
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null, an empty-string otherwise
    • getDateString

      public static <T extends Enum<T>> String getDateString(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a Date value from a WmiResult as a String in ISO 8601 format.
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null, an empty-string otherwise
    • getDateTime

      public static <T extends Enum<T>> OffsetDateTime getDateTime(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a DateTime value from a WmiResult as an OffsetDateTime.
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null, otherwise Constants.UNIX_EPOCH
    • getRefString

      public static <T extends Enum<T>> String getRefString(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a Reference value from a WmiResult as a String.
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null, an empty-string otherwise
    • getUint64

      public static <T extends Enum<T>> long getUint64(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a Uint64 value from a WmiResult (parsing the String).
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null and parseable as a long, 0 otherwise
    • getUint32

      public static <T extends Enum<T>> int getUint32(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a UINT32 value from a WmiResult.
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null, 0 otherwise
    • getUint32asLong

      public static <T extends Enum<T>> long getUint32asLong(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a UINT32 value from a WmiResult as a long, preserving the unsignedness.
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null, 0 otherwise
    • getSint32

      public static <T extends Enum<T>> int getSint32(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a Sint32 value from a WmiResult.
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null, 0 otherwise
    • getUint16

      public static <T extends Enum<T>> int getUint16(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a Uint16 value from a WmiResult.
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null, 0 otherwise
    • getFloat

      public static <T extends Enum<T>> float getFloat(WbemcliUtilFFM.WmiResult<T> result, T property, int index)
      Gets a Float value from a WmiResult.
      Type Parameters:
      T - the property enum type
      Parameters:
      result - The WmiResult from which to fetch the value
      property - The property (column) to fetch
      index - The index (row) to fetch
      Returns:
      The stored value if non-null, 0 otherwise