@Override public SystemProperties compose(SystemProperties other) { // create a new SystemProperties based on this SystemProperties, including all of the other SystemProperties return this.addAll(other); }
@Override public SystemProperties compose(SystemProperties other) { // create a new SystemProperties based on this SystemProperties, including all of the other SystemProperties return this.addAll(other); }
/** * 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); }
/** * 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); }