no message

This commit is contained in:
2024-10-08 16:20:45 +03:00
parent e7939713e7
commit cba2c8ec34
17 changed files with 292 additions and 304 deletions

View File

@@ -1,10 +1,12 @@
package Common;
import Common.Database.Objects.iDBObject;
import Common.Utils.TextLog;
import Common_old.Current;
import java.util.LinkedHashMap;
public interface CurrentAnchestor {
//-
default String getDescription(){
return "?";
}
LinkedHashMap<CurrentAnchestor, Object> objects = new LinkedHashMap<>();
static Object get(CurrentAnchestor name) {
if (!objects.containsKey(name))
@@ -17,14 +19,14 @@ public interface CurrentAnchestor {
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();
}
//применять только для наследников iDBObject
static boolean matchCurrentID(CurrentAnchestor name, int id) {
return (CurrentAnchestor.get(name) != null) && (((iDBObject) CurrentAnchestor.get(name)).id == id);
}
}