@manuth/woltlab-compiler
Version:
A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components
131 lines • 3.26 kB
JavaScript
import { Localization } from "../Globalization/Localization.js";
/**
* Represents a cron-job.
*/
export class CronJob {
/**
* Initializes a new instance of the {@link CronJob `CronJob`} class.
*
* @param options
* The options of the cron-job.
*/
constructor(options) {
/**
* The description of the cron-job.
*/
this.description = new Localization();
/**
* A value indicating whether the cron-job can be disabled.
*/
this.allowDisable = false;
/**
* A value indicating whether the cron-job can be edited.
*/
this.allowEdit = false;
/**
* A set of options of which at least one must be enabled in order to execute the cron-job.
*/
this.options = [];
if ((options.Name !== null) &&
(options.Name !== undefined)) {
this.Name = options.Name;
}
this.ClassName = options.ClassName;
if ((options.Description !== null) &&
(options.Description !== undefined)) {
this.Description.Load(options.Description);
}
if ((options.AllowDisable !== null) &&
(options.AllowDisable !== undefined)) {
this.AllowDisable = options.AllowDisable;
}
if ((options.AllowEdit !== null) &&
(options.AllowEdit !== undefined)) {
this.AllowEdit = options.AllowEdit;
}
if ((options.Options !== null) &&
(options.Options !== undefined)) {
this.Options = options.Options;
}
this.Period = options.Period;
}
/**
* Gets or sets the name of the cron-job.
*/
get Name() {
return this.name;
}
/**
* @inheritdoc
*/
set Name(value) {
this.name = value;
}
/**
* Gets or sets the class-name of the cron-job.
*/
get ClassName() {
return this.className;
}
/**
* @inheritdoc
*/
set ClassName(value) {
this.className = value;
}
/**
* Gets the description of the cron-job.
*/
get Description() {
return this.description;
}
/**
* Gets or sets a value indicating whether the cron-job can be disabled.
*/
get AllowDisable() {
return this.allowDisable;
}
/**
* @inheritdoc
*/
set AllowDisable(value) {
this.allowDisable = value;
}
/**
* Gets or sets a value indicating whether the cron-job can be edited.
*/
get AllowEdit() {
return this.allowEdit;
}
/**
* @inheritdoc
*/
set AllowEdit(value) {
this.allowEdit = value;
}
/**
* Gets or sets a set of options of which at least one must be enabled in order to execute the cron-job.
*/
get Options() {
return this.options;
}
/**
* @inheritdoc
*/
set Options(value) {
this.options = value;
}
/**
* Gets or sets the period to execute the cron-job.
*/
get Period() {
return this.period;
}
/**
* @inheritdoc
*/
set Period(value) {
this.period = value;
}
}
//# sourceMappingURL=CronJob.js.map