BrightSide Workbench Full Report + Source Code
org.turro.scheduler.task.settings.TaskSettings Class Reference
Inheritance diagram for org.turro.scheduler.task.settings.TaskSettings:
Collaboration diagram for org.turro.scheduler.task.settings.TaskSettings:

Public Member Functions

boolean isActive ()
 
void setActive (boolean active)
 
String getImplementation ()
 
void setImplementation (String implementation)
 
String getDescription ()
 
void setDescription (String description)
 
String getData ()
 
void setData (String data)
 
Date getStartDate ()
 
void setStartDate (Date startDate)
 
Date getEndDate ()
 
void setEndDate (Date endDate)
 
TaskConstraints getConstraints ()
 
void setConstraints (TaskConstraints constraints)
 
boolean shouldRun (Date now)
 
AbstractTask build (IConstructor constructor)
 
int compareTo (TaskSettings o)
 
int hashCode ()
 
boolean equals (Object obj)
 

Static Public Member Functions

static TaskSettings from (AbstractTask task)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 33 of file TaskSettings.java.

Member Function Documentation

◆ build()

AbstractTask org.turro.scheduler.task.settings.TaskSettings.build ( IConstructor  constructor)

Definition at line 110 of file TaskSettings.java.

110  {
111  AbstractTask task = (AbstractTask) Reflections.of(getImplementation()).instance();
112  task.setConstructor(constructor);
113  task.setSettings(this);
114  return task;
115  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compareTo()

int org.turro.scheduler.task.settings.TaskSettings.compareTo ( TaskSettings  o)

Definition at line 120 of file TaskSettings.java.

120  {
121  return Comparison.ascendant()
122  .compare(getImplementation(), o.getImplementation())
123  .compare(getDescription(), o.getDescription())
124  .compare(getData(), o.getData())
125  .compare(getConstraints().hashCode(), o.getConstraints().hashCode())
126  .get();
127  }
Here is the call graph for this function:

◆ equals()

boolean org.turro.scheduler.task.settings.TaskSettings.equals ( Object  obj)

Definition at line 145 of file TaskSettings.java.

145  {
146  if (this == obj) {
147  return true;
148  }
149  if (obj == null) {
150  return false;
151  }
152  if (getClass() != obj.getClass()) {
153  return false;
154  }
155  final TaskSettings other = (TaskSettings) obj;
156  if (this.active != other.active) {
157  return false;
158  }
159  if (!Objects.equals(this.implementation, other.implementation)) {
160  return false;
161  }
162  if (!Objects.equals(this.description, other.description)) {
163  return false;
164  }
165  if (!Objects.equals(this.data, other.data)) {
166  return false;
167  }
168  if (!Objects.equals(this.startDate, other.startDate)) {
169  return false;
170  }
171  if (!Objects.equals(this.endDate, other.endDate)) {
172  return false;
173  }
174  return Objects.equals(this.constraints, other.constraints);
175  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from()

static TaskSettings org.turro.scheduler.task.settings.TaskSettings.from ( AbstractTask  task)
static

Definition at line 104 of file TaskSettings.java.

104  {
105  TaskSettings settings = new TaskSettings();
106  settings.setImplementation(task.getClass().getName());
107  return settings;
108  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getConstraints()

TaskConstraints org.turro.scheduler.task.settings.TaskSettings.getConstraints ( )

Definition at line 88 of file TaskSettings.java.

88  {
89  return constraints;
90  }
Here is the caller graph for this function:

◆ getData()

String org.turro.scheduler.task.settings.TaskSettings.getData ( )

Definition at line 64 of file TaskSettings.java.

64  {
65  return data;
66  }
Here is the caller graph for this function:

◆ getDescription()

String org.turro.scheduler.task.settings.TaskSettings.getDescription ( )

Definition at line 56 of file TaskSettings.java.

56  {
57  return description;
58  }
Here is the caller graph for this function:

◆ getEndDate()

Date org.turro.scheduler.task.settings.TaskSettings.getEndDate ( )

Definition at line 80 of file TaskSettings.java.

80  {
81  return endDate;
82  }

◆ getImplementation()

String org.turro.scheduler.task.settings.TaskSettings.getImplementation ( )

Definition at line 48 of file TaskSettings.java.

48  {
49  return implementation;
50  }
Here is the caller graph for this function:

◆ getStartDate()

Date org.turro.scheduler.task.settings.TaskSettings.getStartDate ( )

Definition at line 72 of file TaskSettings.java.

72  {
73  return startDate;
74  }

◆ hashCode()

int org.turro.scheduler.task.settings.TaskSettings.hashCode ( )

Definition at line 132 of file TaskSettings.java.

132  {
133  int hash = 3;
134  hash = 23 * hash + (this.active ? 1 : 0);
135  hash = 23 * hash + Objects.hashCode(this.implementation);
136  hash = 23 * hash + Objects.hashCode(this.description);
137  hash = 23 * hash + Objects.hashCode(this.data);
138  hash = 23 * hash + Objects.hashCode(this.startDate);
139  hash = 23 * hash + Objects.hashCode(this.endDate);
140  hash = 23 * hash + Objects.hashCode(this.constraints);
141  return hash;
142  }
Here is the caller graph for this function:

◆ isActive()

boolean org.turro.scheduler.task.settings.TaskSettings.isActive ( )

Definition at line 40 of file TaskSettings.java.

40  {
41  return active;
42  }

◆ setActive()

void org.turro.scheduler.task.settings.TaskSettings.setActive ( boolean  active)

Definition at line 44 of file TaskSettings.java.

44  {
45  this.active = active;
46  }

◆ setConstraints()

void org.turro.scheduler.task.settings.TaskSettings.setConstraints ( TaskConstraints  constraints)

Definition at line 92 of file TaskSettings.java.

92  {
93  this.constraints = constraints;
94  }

◆ setData()

void org.turro.scheduler.task.settings.TaskSettings.setData ( String  data)

Definition at line 68 of file TaskSettings.java.

68  {
69  this.data = data;
70  }

◆ setDescription()

void org.turro.scheduler.task.settings.TaskSettings.setDescription ( String  description)

Definition at line 60 of file TaskSettings.java.

60  {
61  this.description = description;
62  }

◆ setEndDate()

void org.turro.scheduler.task.settings.TaskSettings.setEndDate ( Date  endDate)

Definition at line 84 of file TaskSettings.java.

84  {
85  this.endDate = endDate;
86  }

◆ setImplementation()

void org.turro.scheduler.task.settings.TaskSettings.setImplementation ( String  implementation)

Definition at line 52 of file TaskSettings.java.

52  {
53  this.implementation = implementation;
54  }
Here is the caller graph for this function:

◆ setStartDate()

void org.turro.scheduler.task.settings.TaskSettings.setStartDate ( Date  startDate)

Definition at line 76 of file TaskSettings.java.

76  {
77  this.startDate = startDate;
78  }

◆ shouldRun()

boolean org.turro.scheduler.task.settings.TaskSettings.shouldRun ( Date  now)

Definition at line 96 of file TaskSettings.java.

96  {
97  return (startDate == null || now.after(startDate)) &&
98  (endDate == null || now.before(endDate)) &&
99  getConstraints().isValid(now);
100  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: