use of com.oracle.bedrock.runtime.java.options.SystemProperty in project oracle-bedrock by coherence-community.
the class Ports method asMappedProperties.
/**
* Obtain a {@link SystemProperties} instance that is a copy of the specified
* {@link SystemProperties} with all of the properties contained within this
* {@link Ports} altered to be the value of the mapped ports.
*
* @param properties the {@link SystemProperties} to copy
*
* @return a {@link SystemProperties} with the mapped port values
*/
public SystemProperties asMappedProperties(SystemProperties properties) {
SystemProperties copy = new SystemProperties(properties);
Map<String, Object> mappedProperties = new HashMap<>();
for (SystemProperty property : properties) {
String name = property.getName();
if (ports.containsKey(name)) {
Port port = ports.get(name);
mappedProperties.put(name, port.getMappedPort());
}
}
return copy.addAll(mappedProperties);
}
Aggregations