@Override public SystemProperties without(SystemProperty property) { return remove(property.getName()); }
@Override public SystemProperties without(SystemProperty property) { return remove(property.getName()); }
/** * Adds all of the {@link SystemProperties} to this {@link SystemProperties} * returning a new {@link SystemProperties}. * * @param properties the {@link SystemProperties} * * @return a new {@link SystemProperties} */ public SystemProperties addAll(SystemProperties properties) { SystemProperties systemProperties = new SystemProperties(this); for (SystemProperty property : properties) { systemProperties.properties.put(property.getName(), property); } return systemProperties; }
/** * Adds all of the {@link SystemProperties} to this {@link SystemProperties} * returning a new {@link SystemProperties}. * * @param properties the {@link SystemProperties} * * @return a new {@link SystemProperties} */ public SystemProperties addAll(SystemProperties properties) { SystemProperties systemProperties = new SystemProperties(this); for (SystemProperty property : properties) { systemProperties.properties.put(property.getName(), property); } return systemProperties; }
/** * Adds the specified {@link SystemProperty} to the {@link SystemProperties}, returning a new * {@link SystemProperties} containing the {@link SystemProperty} * (if and only if a {@link SystemProperty} with the same name doesn't already exist). * * @param property the {@link SystemProperty} to add * * @return the a new {@link SystemProperties} instance, including the existing {@link SystemProperty}s and the new {@link SystemProperty} */ public SystemProperties addIfAbsent(SystemProperty property) { if (property == null || properties.containsKey(property.getName())) { return this; } else { return add(property); } }
/** * Adds the specified {@link SystemProperty} to the {@link SystemProperties}, returning a new * {@link SystemProperties} containing the {@link SystemProperty} * (if and only if a {@link SystemProperty} with the same name doesn't already exist). * * @param property the {@link SystemProperty} to add * * @return the a new {@link SystemProperties} instance, including the existing {@link SystemProperty}s and the new {@link SystemProperty} */ public SystemProperties addIfAbsent(SystemProperty property) { if (property == null || properties.containsKey(property.getName())) { return this; } else { return add(property); } }
/** * Adds the specified {@link SystemProperty} to the {@link SystemProperties}, returning a new * {@link SystemProperties} containing the {@link SystemProperty}. * * @param properties the {@link SystemProperty}s to add * * @return the a new {@link SystemProperties} instance, including * the existing {@link SystemProperty}s and the new {@link SystemProperty} */ public SystemProperties add(SystemProperty... properties) { if (properties == null || properties.length == 0) { return this; } else { SystemProperties systemProperties = new SystemProperties(this); for (SystemProperty property : properties) { systemProperties.properties.put(property.getName(), property); } return systemProperties; } }
/** * Adds the specified {@link SystemProperty} to the {@link SystemProperties}, returning a new * {@link SystemProperties} containing the {@link SystemProperty}. * * @param properties the {@link SystemProperty}s to add * * @return the a new {@link SystemProperties} instance, including * the existing {@link SystemProperty}s and the new {@link SystemProperty} */ public SystemProperties add(SystemProperty... properties) { if (properties == null || properties.length == 0) { return this; } else { SystemProperties systemProperties = new SystemProperties(this); for (SystemProperty property : properties) { systemProperties.properties.put(property.getName(), property); } return systemProperties; } }
/** * 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); }
String name = property.getName(); Object value = property.getValue();
String name = property.getName(); Object value = property.getValue();