1 package org.simantics.structural.synchronization.base;
3 import java.util.function.BiConsumer;
5 public interface SolverNameUtil {
7 String getFreshName(String parentName, String name);
8 String ensureNameIsVariationOf(String parentName, int id, String name);
11 * The name utility can internally keep track of
12 * <code>suggested name -> generated
13 * fresh name</code> associations that it has had to perform during its
14 * lifetime in {@link #getFreshName(String, String)}. If the implementation
15 * keeps track of these renames, the purpose of this method is to check
16 * whether at the time of invocation it is possible to rename the solver
17 * components to their suggested names or not. For every rename that is
18 * performed, the specified consumer shall be invoked with the arguments
19 * <code>(previous name, new name)</code> after the rename has been
23 * This method is intended to be invoked right at the end of
27 * a binary consumer that takes as first argument the previous
28 * name of the renamed component and as second argument the new
29 * (current) name of the component or <code>null</code> to skip
32 default void applySuggestedNames(BiConsumer<String, String> callback) {}