Package org.metricshub.wmi
Class WmiStringConverter
java.lang.Object
org.metricshub.wmi.WmiStringConverter
-
Constructor Summary
ConstructorsConstructorDescriptionCreate 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 TypeMethodDescriptionConvert 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: usingString.valueOf()
-
Constructor Details
-
WmiStringConverter
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 arraysuseEpoch
- 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
-
-
Method Details
-
convert
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
-