public class ExportCollector extends Object
Collector that can be used collect a stream() of
PropertyExports into key-value pair Maps or Properties.
See AndHow#export() for export details and examples.
| Modifier and Type | Method and Description |
|---|---|
static org.yarnandtail.andhow.export.ExportCollector.ObjectMap |
objectMap()
Returns a
Collector that collects PropertyExports into a
Map<String, Object> collection of key-value pairs. |
static org.yarnandtail.andhow.export.ExportCollector.ObjectProperties |
objectProperties(Object nullValue)
Returns a
Collector that collects PropertyExports into a
Properties object with key-value entries that have Strings
keys and Object values. |
static org.yarnandtail.andhow.export.ExportCollector.StringMap |
stringMap()
Returns a
Collector that collects PropertyExports into a
Map<String, String> collection of key-value pairs. |
static org.yarnandtail.andhow.export.ExportCollector.StringProperties |
stringProperties(String nullValueString)
Returns a
Collector that collects PropertyExports into a
Properties object with key-value entries that are Strings. |
public static org.yarnandtail.andhow.export.ExportCollector.StringMap stringMap()
Collector that collects PropertyExports into a
Map<String, String> collection of key-value pairs.
Usage example:
Map<String, String> export =
AndHow.instance().export(MyClass.class)
.collect(ExportCollector.stringMap());
Note: This method calls PropertyExport.getValueAsString() for the
'value' part of the key-value pair. That value can be remapped - See
PropertyExport.mapValueAsString(String).
See AndHow#export() for export details and more examples.
Collector that creates a Map<String, String>
from a PropertyExport stream.public static org.yarnandtail.andhow.export.ExportCollector.StringProperties stringProperties(String nullValueString)
Collector that collects PropertyExports into a
Properties object with key-value entries that are Strings.
Usage example:
Map<String, String> export =
AndHow.instance().export(MyClass.class)
.collect(ExportCollector.stringProperties());
Note: This method calls PropertyExport.getValueAsString() for the
'value' part of the key-value pair. That value can be remapped - See
PropertyExport.mapValueAsString(String).
See AndHow#export() for export details and more examples.
nullValueString - The value to use for Properties that have a null
value, since Properties cannot contain null values.Collector that creates a Properties with String
values from a PropertyExport stream.public static org.yarnandtail.andhow.export.ExportCollector.ObjectMap objectMap()
Collector that collects PropertyExports into a
Map<String, Object> collection of key-value pairs.
Usage example:
Map<String, String> export =
AndHow.instance().export(MyClass.class)
.collect(ExportCollector.objectMap());
Note: This method calls PropertyExport.getValue() for the
'value' part of the key-value pair. That value can be remapped - See
PropertyExport.mapValue(Object).
See AndHow#export() for export details and more examples.
Collector that creates a Map<String, Object>
from a PropertyExport stream.public static org.yarnandtail.andhow.export.ExportCollector.ObjectProperties objectProperties(Object nullValue)
Collector that collects PropertyExports into a
Properties object with key-value entries that have Strings
keys and Object values.
Usage example:
Map<String, String> export =
AndHow.instance().export(MyClass.class)
.collect(ExportCollector.objectProperties());
Note: This method calls PropertyExport.getValue() for the
'value' part of the key-value pair. That value can be remapped - See
PropertyExport.mapValue(Object).
See AndHow#export() for export details and more examples.
nullValue - The value to use for Properties that have a null value, since
Properties cannot contain null values.Collector that creates a Properties with String
keys and Object values from a PropertyExport stream.Copyright © 2022. All rights reserved.