рефакторинг. переносил текущие объекты в другое место
This commit is contained in:
@@ -7,26 +7,4 @@ public interface Current_ {
|
||||
default String getDescription(){
|
||||
return "?";
|
||||
}
|
||||
LinkedHashMap<Current_, Object> objects = new LinkedHashMap<>();
|
||||
static Object get(Current_ name) {
|
||||
if (!objects.containsKey(name))
|
||||
objects.put(name,null);
|
||||
return objects.get(name);
|
||||
}
|
||||
static Object set(Current_ name, Object object) {
|
||||
if (objects.containsKey(name))
|
||||
objects.replace(name, object);
|
||||
else objects.put(name, object);
|
||||
return object;
|
||||
}
|
||||
static boolean Check(TextLog Log, Current_... names) {
|
||||
for (Current_ name : names)
|
||||
if (Current_.get(name) == null)
|
||||
Log.Writeln_(name.getDescription() + " не выбран(а)");
|
||||
return Log.isEmpty();
|
||||
}
|
||||
//применять только для наследников iDBObject
|
||||
static boolean matchCurrentID(Current_ name, int id) {
|
||||
return (Current_.get(name) != null) && (((iDBObject) Current_.get(name)).id == id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user