продолжение рефакторинга. создал предка для класса current

This commit is contained in:
2024-10-08 00:39:13 +03:00
parent 3516b58127
commit d0c08a2c7e
157 changed files with 648 additions and 421 deletions

View File

@@ -0,0 +1,30 @@
package Common;
import Common.Utils.TextLog;
import Common_old.Current;
import java.util.LinkedHashMap;
public interface CurrentAnchestor {
//-
LinkedHashMap<CurrentAnchestor, Object> objects = new LinkedHashMap<>();
static Object get(CurrentAnchestor name) {
if (!objects.containsKey(name))
objects.put(name,null);
return objects.get(name);
}
static Object set(CurrentAnchestor name, Object object) {
if (objects.containsKey(name))
objects.replace(name, object);
else objects.put(name, object);
return object;
}
default String getDescription(){
return "?";
}
static boolean Check(TextLog Log, CurrentAnchestor... names) {
for (CurrentAnchestor name : names)
if (CurrentAnchestor.get(name) == null)
Log.Writeln_(name.getDescription() + " не выбран(а)");
return Log.isEmpty();
}
}