Licensed module system. Minor changes
- Added license commetary to each file of module system - Added default meta info generation for Module
This commit is contained in:
parent
c7842935ba
commit
7f57510ac8
@ -1,3 +1,20 @@
|
||||
/*
|
||||
* Progressia
|
||||
* Copyright (C) 2020-2021 Wind Corporation and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ru.windcorp.progressia.common.modules;
|
||||
|
||||
import ru.windcorp.progressia.common.util.namespaces.Namespaced;
|
||||
@ -13,6 +30,7 @@ public class Module extends Namespaced {
|
||||
|
||||
public Module(String id) {
|
||||
super(id);
|
||||
meta.put("id", id);
|
||||
}
|
||||
|
||||
public Map<String, String> getMeta() {
|
||||
|
@ -1,14 +1,31 @@
|
||||
/*
|
||||
* Progressia
|
||||
* Copyright (C) 2020-2021 Wind Corporation and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ru.windcorp.progressia.common.modules;
|
||||
|
||||
public class ModuleBuilder {
|
||||
private final Module module;
|
||||
private final Module module;
|
||||
|
||||
public ModuleBuilder(String id) {
|
||||
module = new Module(id);
|
||||
}
|
||||
public ModuleBuilder(String id) {
|
||||
module = new Module(id);
|
||||
}
|
||||
|
||||
public ModuleBuilder AddTask(Task task) {
|
||||
module.addTask(task);
|
||||
return this;
|
||||
}
|
||||
public ModuleBuilder AddTask(Task task) {
|
||||
module.addTask(task);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,20 @@
|
||||
/*
|
||||
* Progressia
|
||||
* Copyright (C) 2020-2021 Wind Corporation and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ru.windcorp.progressia.common.modules;
|
||||
|
||||
import ru.windcorp.progressia.common.util.crash.CrashReports;
|
||||
@ -58,8 +75,12 @@ public abstract class Task
|
||||
requiredTasks.add(task);
|
||||
}
|
||||
|
||||
public Module getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(Module module) {
|
||||
if(owner != null) {
|
||||
if (owner != null) {
|
||||
CrashReports.crash(
|
||||
new Exception("Owner is not null")
|
||||
, "Could not set %s as owner of %s, because %s is already owner of it.",
|
||||
@ -68,8 +89,4 @@ public abstract class Task
|
||||
owner = module;
|
||||
}
|
||||
}
|
||||
|
||||
public Module getOwner() {
|
||||
return owner;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,20 @@
|
||||
/*
|
||||
* Progressia
|
||||
* Copyright (C) 2020-2021 Wind Corporation and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ru.windcorp.progressia.common.modules;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
Reference in New Issue
Block a user