Class WmiStringConverter

java.lang.Object
org.metricshub.wmi.WmiStringConverter

public class WmiStringConverter extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new converter with the default characteristics: pipe to separate values in arrays convert date/time values to seconds to Epoch Use this class to convert values in the returned list of map in WmiWbemServicesHanlde#executeWQLQuery.
    WmiStringConverter(String arraySeparator, boolean useEpoch)
    Create a new converter with the specified characteristics.
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(Object value)
    Convert the specified value/object to a string: OffsetDateTime: to number of seconds since Epoch, or standard English date/time Array: items separated with specified arraySeparator null: empty string Boolean: True or False Anything else: using String.valueOf()

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WmiStringConverter

      public WmiStringConverter(String arraySeparator, boolean useEpoch)
      Create a new converter with the specified characteristics. Use this class to convert values in the returned list of map in WmiWbemServicesHanlde#executeWQLQuery.
      Parameters:
      arraySeparator - What character to use to separate values in arrays
      useEpoch - Whether to convert date/times to seconds to Epoch or not
    • WmiStringConverter

      public WmiStringConverter()
      Create a new converter with the default characteristics:
      • pipe to separate values in arrays
      • convert date/time values to seconds to Epoch
      Use this class to convert values in the returned list of map in WmiWbemServicesHanlde#executeWQLQuery.
  • Method Details

    • convert

      public String convert(Object value)
      Convert the specified value/object to a string:
      • OffsetDateTime: to number of seconds since Epoch, or standard English date/time
      • Array: items separated with specified arraySeparator
      • null: empty string
      • Boolean: True or False
      • Anything else: using String.valueOf()
      Parameters:
      value - to convert to string
      Returns:
      a string