Sets the replacement var map node specific.

@param replacementVarMapNodeSpecific
the replacement var map node specific
@return the parallel task builder
343230
public ParallelTaskBuilder setReplacementVarMapNodeSpecific(
            Map<String, StrStrMap> replacementVarMapNodeSpecific) {
        this.replacementVarMapNodeSpecific.clear();
        this.replacementVarMapNodeSpecific
                .putAll(replacementVarMapNodeSpecific);

        this.requestReplacementType = RequestReplacementType.TARGET_HOST_SPECIFIC_VAR_REPLACEMENT;
        logger.info("Set requestReplacementType as {}"
                + requestReplacementType.toString());
        return this;
    }
160171
public MapBuilder<K, V> put(K k, V v) {
		map.put(k, v);
		return this;
	}
125555
public <T> SameType<T> mapToSame(Function<? super E, ? extends T> mapExpected, Function<? super A, ? extends T> mapActual) {
		return new SameTypeImp<>(this, mapExpected, mapActual);
	}
944286
public static String replaceByMap(String _searchStr, Map<String, String> _replacements) {
        if (_searchStr == null) {
            return null;
        }
        if (_replacements == null || _replacements.isEmpty()) {
            return _searchStr;
        }

        String str = _searchStr;

        for (Entry<String, String> entry : _replacements.entrySet()) {
            str = str.replace(entry.getKey(), entry.getValue());
        }

        return str;
    }
244624
public static <T extends ViewTraverse<T>> Map<String, Object> replaceDataReferences(
            final Map<String, Object> input,
            final T currentContext,
            final BiFunction<Integer, String, T> viewMap,
            final Converter<String, String> converter,
            final MultiDataContext<T, DataContext> data,
            boolean failOnUnexpanded,
            boolean blankIfUnexpanded
    )
    {
        final HashMap<String, Object> output = new HashMap<>();
        for (final String s : input.keySet()) {
            Object o = input.get(s);
            output.put(
                    s,
                    replaceDataReferencesInObject(o,
                                                  currentContext,
                                                  viewMap,
                                                  converter,
                                                  data,
                                                  failOnUnexpanded,
                                                  blankIfUnexpanded
                    )
            );
        }
        return output;
    }
512614
public Data replace(Iterable<Property> replacement) {
        if (Iterables.isEmpty(replacement)) {
            return this;
        }
        Map<String, Property> map = getDataAsMap(replacement);

        List<Property> props = this.stream().
                map(f -> map.getOrDefault(f.getName(), f)).
                collect(Collectors.toList());

        return new Data(props);
    }
637589
public <T extends ThreadPoolTaskExecutor> T configure(T taskExecutor) {
		PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
		map.from(this.queueCapacity).to(taskExecutor::setQueueCapacity);
		map.from(this.corePoolSize).to(taskExecutor::setCorePoolSize);
		map.from(this.maxPoolSize).to(taskExecutor::setMaxPoolSize);
		map.from(this.keepAlive).asInt(Duration::getSeconds)
				.to(taskExecutor::setKeepAliveSeconds);
		map.from(this.allowCoreThreadTimeOut).to(taskExecutor::setAllowCoreThreadTimeOut);
		map.from(this.awaitTermination)
				.to(taskExecutor::setWaitForTasksToCompleteOnShutdown);
		map.from(this.awaitTerminationPeriod).asInt(Duration::getSeconds)
				.to(taskExecutor::setAwaitTerminationSeconds);
		map.from(this.threadNamePrefix).whenHasText()
				.to(taskExecutor::setThreadNamePrefix);
		map.from(this.taskDecorator).to(taskExecutor::setTaskDecorator);
		if (!CollectionUtils.isEmpty(this.customizers)) {
			this.customizers.forEach((customizer) -> customizer.customize(taskExecutor));
		}
		return taskExecutor;
	}
1306301
private void convertNode(final GraphObjectMap map, final Node node) {

		final NodeList nodeList = node.getChildNodes();
		if (nodeList != null) {

			final List<GraphObjectMap> children = new LinkedList<>();
			final int length                    = nodeList.getLength();

			for (int i=0; i<length; i++) {

				final GraphObjectMap childMap = new GraphObjectMap();
				final Node childNode          = nodeList.item(i);

				convertNode(childMap, childNode);
				children.add(childMap);
			}

			map.put(childrenProperty, children);
		}

		final NamedNodeMap attributeList = node.getAttributes();
		if (attributeList != null) {

			final List<GraphObjectMap> attributes = new LinkedList<>();
			final int length                      = attributeList.getLength();

			for (int i=0; i<length; i++) {

				final GraphObjectMap attributeMap = new GraphObjectMap();
				final Node attributeNode          = attributeList.item(i);

				convertNode(attributeMap, attributeNode);
				attributes.add(attributeMap);
			}

			map.put(attributesProperty, attributes);
		}

		map.put(typeProperty, node.getClass().getSimpleName());

		final String nodeName = node.getNodeName();
		if (nodeName != null) {

			map.put(nameProperty, nodeName);
		}

		final String nodeValue = node.getNodeValue();
		if (nodeValue != null) {

			map.put(valueProperty, nodeValue);
		}
	}
736414
private Optional<IQ> mergeDefinitions(Collection<IQ> predicateDefinitions,
                                          Optional<ImmutableQueryModifiers> optionalTopModifiers) {
        if (predicateDefinitions.isEmpty())
            return Optional.empty();

        IQ firstDefinition = predicateDefinitions.iterator().next();
        if (predicateDefinitions.size() == 1) {
            return Optional.of(firstDefinition);
        }

        DistinctVariableOnlyDataAtom projectionAtom = firstDefinition.getProjectionAtom();

        VariableGenerator variableGenerator =  coreUtilsFactory.createVariableGenerator(firstDefinition.getTree().getKnownVariables());

        Stream<IQTree> renamedDefinitions = predicateDefinitions.stream()
                .skip(1)
                .map(def -> {
                    // Updates the variable generator
                    InjectiveVar2VarSubstitution disjointVariableSetRenaming = substitutionFactory.generateNotConflictingRenaming(
                            variableGenerator, def.getTree().getKnownVariables());

                    ImmutableSet<Variable> freshVariables = ImmutableSet.copyOf(
                            disjointVariableSetRenaming.getImmutableMap().values());

                    InjectiveVar2VarSubstitution headSubstitution = computeRenamingSubstitution(
                            disjointVariableSetRenaming.applyToDistinctVariableOnlyDataAtom(def.getProjectionAtom()),
                            projectionAtom)
                            .orElseThrow(() -> new IllegalStateException("Bug: unexpected incompatible atoms"));

                    InjectiveVar2VarSubstitution renamingSubstitution =
                            /*
                              fresh variables are excluded from the domain of the renaming substitution
                               since they are in use in the sub-query.

                               NB: this guarantees that the renaming substitution is injective
                             */
                            headSubstitution.composeWithAndPreserveInjectivity(disjointVariableSetRenaming, freshVariables)
                                    .orElseThrow(() -> new IllegalStateException("Bug: the renaming substitution is not injective"));

                    QueryRenamer queryRenamer = transformerFactory.createRenamer(renamingSubstitution);
                    return queryRenamer.transform(def).getTree();
                });

        ImmutableList<IQTree> unionChildren = Stream.concat(Stream.of(firstDefinition.getTree()), renamedDefinitions)
                .collect(ImmutableCollectors.toList());

        IQTree unionTree = iqFactory.createNaryIQTree(iqFactory.createUnionNode(projectionAtom.getVariables()),
                unionChildren);

        IQTree tree = optionalTopModifiers
                .map(m -> m.insertAbove(unionTree, iqFactory))
                .orElse(unionTree);

        return Optional.of(iqFactory.createIQ(projectionAtom, tree));
    }
1054036
@SuppressWarnings("unchecked")
    public <T extends WebLocatorAbstractBuilder> T setTemplate(final String key, final String value) {
        pathBuilder.setTemplate(key, value);
        return (T) this;
    }
813536
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
  {

    error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"replaceChild not supported!");

    return null;
  }
697325
public Assignment mapVariables(Map<Integer, Integer> varMap) {
    int[] newVarNums = new int[vars.length];
    Object[] newValues = new Object[vars.length];

    int numFilled = 0;
    for (int i = 0; i < vars.length; i++) {
      if (varMap.containsKey(vars[i])) {
        newVarNums[numFilled] = varMap.get(vars[i]);
        newValues[numFilled] = values[i];
        numFilled++;
      }
    }
    
    if (numFilled < newVarNums.length) {
      newVarNums = Arrays.copyOf(newVarNums, numFilled);
      newValues = Arrays.copyOf(newValues, numFilled);
    }
    return Assignment.fromUnsortedArrays(newVarNums, newValues);
  }
632544
protected IntermediateQueryBuilder convertToBuilderAndTransform(IntermediateQuery originalQuery,
                                                                  HomogeneousQueryNodeTransformer nodeTransformer,
                                                                  DistinctVariableOnlyDataAtom transformedProjectionAtom) {
        IntermediateQueryBuilder queryBuilder = originalQuery.newBuilder();

        // Clone the original root node and apply the transformer if available.
        QueryNode originalRootNode = originalQuery.getRootNode();
        QueryNode newRootNode;
        newRootNode = originalRootNode.acceptNodeTransformer(nodeTransformer);
        queryBuilder.init(transformedProjectionAtom, newRootNode);
        return copyChildrenNodesToBuilder(originalQuery, queryBuilder, originalRootNode, newRootNode, nodeTransformer);
    }
402017
private void buildReplacementNodesFromSource(MsgNode msg) {

    currReplacementNodes = Lists.newArrayList();

    for (StandaloneNode child : msg.getChildren()) {

      if (child instanceof RawTextNode) {
        currReplacementNodes.add(child);

      } else if (child instanceof MsgPlaceholderNode) {
        for (StandaloneNode contentNode : ((MsgPlaceholderNode) child).getChildren()) {
          // If the content node is a MsgHtmlTagNode, it needs to be replaced by a number of
          // consecutive siblings. This is done by visiting the MsgHtmlTagNode. Otherwise, we
          // simply add the content node to the currReplacementNodes list being built.
          if (contentNode instanceof MsgHtmlTagNode) {
            currReplacementNodes.addAll(((MsgHtmlTagNode) contentNode).getChildren());
          } else {
            currReplacementNodes.add(contentNode);
          }
        }

      } else {
        throw new AssertionError();
      }
    }
  }
256507
public static IterationBuilderOver over(String source)
    {
        Iteration iterationImpl = new Iteration(new NamedFramesSelector(source));
        iterationImpl.setPayloadManager(new NamedIterationPayloadManager(singleVariableIterationName(source)));
        return iterationImpl;
    }
165541
@Override
	public ResultTransformer createMapping(final App app, final String sourceType, final String targetType, final Map<String, String> propertyMappings, final Map<String, String> transforms) throws FrameworkException {

		try (final Tx tx = app.tx()) {

			final VirtualType type = app.create(VirtualType.class,
				new NodeAttribute<>(StructrApp.key(VirtualType.class, "sourceType"), sourceType),
				new NodeAttribute<>(StructrApp.key(VirtualType.class, "name"),       targetType)
			);

			int i = 0;

			for (final Entry<String, String> entry : propertyMappings.entrySet()) {

				final String sourceProperty = entry.getKey();
				final String targetProperty = entry.getValue();

				app.create(VirtualProperty.class,
					new NodeAttribute<>(StructrApp.key(VirtualProperty.class, "virtualType"),   type),
					new NodeAttribute<>(StructrApp.key(VirtualProperty.class, "sourceName"),    sourceProperty),
					new NodeAttribute<>(StructrApp.key(VirtualProperty.class, "targetName"),    targetProperty),
					new NodeAttribute<>(StructrApp.key(VirtualProperty.class, "position"),      i++),
					new NodeAttribute<>(StructrApp.key(VirtualProperty.class, "inputFunction"), transforms.get(sourceProperty))
				);
			}

			tx.success();

			return type;
		}
	}
1347124
private static SubstUnitInfo genFinalSubstUnitInfoMapsHelper(
      RepresentativeNodes representativeNodes) {

    // ------ Step 1: Build final map of var name to representative node. ------
    //
    // The final map substUnitVarNameToRepNodeMap must be a one-to-one mapping. If a base name only
    // maps to one representative node, then we simply put that same mapping into the final map. But
    // if a base name maps to multiple nodes, we must append number suffixes ("_1", "_2", etc) to
    // make the names unique.
    //
    // Note: We must be careful that, while appending number suffixes, we don't generate a new name
    // that is the same as an existing base name.

    Map<String, MsgSubstUnitNode> substUnitVarNameToRepNodeMap = new LinkedHashMap<>();

    for (String baseName : representativeNodes.baseNameToRepNodesMap().keys()) {
      List<MsgSubstUnitNode> nodesWithSameBaseName =
          representativeNodes.baseNameToRepNodesMap().get(baseName);
      if (nodesWithSameBaseName.size() == 1) {
        substUnitVarNameToRepNodeMap.put(baseName, nodesWithSameBaseName.get(0));
      } else {
        // Case 2: Multiple nodes generate this base name. Need number suffixes.
        int nextSuffix = 1;
        for (MsgSubstUnitNode repNode : nodesWithSameBaseName) {
          String newName;
          do {
            newName = baseName + "_" + nextSuffix;
            ++nextSuffix;
          } while (representativeNodes.baseNameToRepNodesMap().containsKey(newName));
          substUnitVarNameToRepNodeMap.put(newName, repNode);
        }
      }
    }

    // ------ Step 2: Create map of every node to its var name. ------

    Map<MsgSubstUnitNode, PlaceholderInfo> substUnitNodeToVarNameMap = new LinkedHashMap<>();

    // Reverse the map of names to representative nodes.
    for (Map.Entry<String, MsgSubstUnitNode> entry : substUnitVarNameToRepNodeMap.entrySet()) {
      substUnitNodeToVarNameMap.put(
          entry.getValue(),
          PlaceholderInfo.create(
              entry.getKey(), representativeNodes.repNodeToPhExample().get(entry.getValue())));
    }

    // Add mappings for the non-representative nodes.
    for (Map.Entry<MsgSubstUnitNode, MsgSubstUnitNode> entry :
        representativeNodes.nonRepNodeToRepNodeMap().entrySet()) {
      MsgSubstUnitNode nonRepNode = entry.getKey();
      MsgSubstUnitNode repNode = entry.getValue();
      substUnitNodeToVarNameMap.put(nonRepNode, substUnitNodeToVarNameMap.get(repNode));
    }

    return new SubstUnitInfo(
        ImmutableMap.copyOf(substUnitVarNameToRepNodeMap),
        ImmutableMap.copyOf(substUnitNodeToVarNameMap));
  }