]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/SolverNameUtil.java
Sync git svn branch with SVN repository r33366.
[simantics/platform.git] / bundles / org.simantics.structural.synchronization.client / src / org / simantics / structural / synchronization / base / SolverNameUtil.java
1 package org.simantics.structural.synchronization.base;\r
2 \r
3 import java.util.function.BiConsumer;\r
4 \r
5 public interface SolverNameUtil {\r
6 \r
7         String getFreshName(String parentName, String name);\r
8         String ensureNameIsVariationOf(String parentName, int id, String name);\r
9 \r
10         /**\r
11          * The name utility can internally keep track of\r
12          * <code>suggested name -> generated\r
13          * fresh name</code> associations that it has had to perform during its\r
14          * lifetime in {@link #getFreshName(String, String)}. If the implementation\r
15          * keeps track of these renames, the purpose of this method is to check\r
16          * whether at the time of invocation it is possible to rename the solver\r
17          * components to their suggested names or not. For every rename that is\r
18          * performed, the specified consumer shall be invoked with the arguments\r
19          * <code>(previous name, new name)</code> after the rename has been\r
20          * performed.\r
21          * \r
22          * <p>\r
23          * This method is intended to be invoked right at the end of\r
24          * synchronization.\r
25          * \r
26          * @param callback\r
27          *            a binary consumer that takes as first argument the previous\r
28          *            name of the renamed component and as second argument the new\r
29          *            (current) name of the component or <code>null</code> to skip\r
30          *            callback invocation\r
31          */\r
32         default void applySuggestedNames(BiConsumer<String, String> callback) {}\r
33 \r
34 }\r