/** * This is the operation to get the existing or recalculated properties. * @return the properties for this propertyset. */ public Properties getProperties() { final Properties result = new Properties(); result.putAll(getPropertyMap()); return result; }
/** * A debug toString. * This gets a comma separated list of key=value pairs for * the properties in the set. * The output order is sorted according to the keys' <i>natural order</i>. * @return a string rep of this object. */ @Override public String toString() { if (isReference()) { return getRef().toString(); } dieOnCircularReference(); return new TreeMap<>(getPropertyMap()).entrySet().stream() .map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.joining(", ")); }
private Map<String, Object> getEffectiveProperties() { final Project prj = getProject(); final Map<String, Object> result = prj == null ? getAllSystemProperties() : prj.getProperties(); //quick & dirty, to make nested mapped p-sets work: for (PropertySet set : setRefs) { result.putAll(set.getPropertyMap()); } return result; }
private Set<String> getPropertyNames(Map<String, Object> props) { Set<String> names; if (getDynamic() || cachedNames == null) { names = new HashSet<>(); addPropertyNames(names, props); // Add this PropertySet's nested PropertySets' property names. for (PropertySet set : setRefs) { names.addAll(set.getPropertyMap().keySet()); } if (negate) { //make a copy... HashSet<String> complement = new HashSet<>(props.keySet()); complement.removeAll(names); names = complement; } if (!getDynamic()) { cachedNames = names; } } else { names = cachedNames; } return names; }
return getRef().getPropertyMap();