/** * Maps a map of {@code Map<String,String>} to a {@code Map<String,PropertyValue>}. * * @param config the String based map, not {@code null}. * @param source the source name, not {@code null}. * @param metaData additional metadata, not {@code null}. * @return the corresponding value based map. */ public static Map<String,PropertyValue> map(Map<String, String> config, String source, Map<String,String> metaData) { Objects.requireNonNull(config, "Config must be given."); Objects.requireNonNull(source, "Source must be given."); Objects.requireNonNull(metaData, "Meta data must be given."); Map<String,PropertyValue> result = new HashMap<>(config.size()); for(Map.Entry<String,String> en:config.entrySet()){ PropertyValue value = new PropertyValueBuilder(en.getKey(), source).setValue(en.getValue()) .addMetaEntries(metaData).build(); result.put(en.getKey(), value); } return result; } }
@Override public Map<String, PropertyValue> getProperties() { Map<String,PropertyValue> result = new HashMap<>(); for(PropertyValue val : source.getProperties().values()) { String mappedValue = valueFilter.mapProperty(val.getKey(), val.getValue()); PropertyValue value = val.toBuilder().setValue(mappedValue).build(); result.put(val.getKey(), value); } return result; }
props.put(reqKey+".lockIndex", String.valueOf(value.getLockIndex())); props.put(reqKey+".flags", String.valueOf(value.getFlags())); return new PropertyValueBuilder(key, value.getValue().get(), getName()).setContextData(props).build();
String mappedName = getName(); return property.toBuilder().mapKey(newKey) .setSource(mappedName).build();
String newVal = evaluator().evaluateExpression(valueToBeFiltered.getKey(), valueToBeFiltered.getValue(), true); if(newVal!=null){ return valueToBeFiltered.toBuilder().setValue(newVal).build();