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

Public Member Functions

boolean isValid (Date date)
 
boolean needsRefresh ()
 
Month getMonth (Date date)
 

Detailed Description

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

Definition at line 29 of file task/constraints/MonthConstraint.java.

Member Function Documentation

◆ getMonth()

Month org.turro.scheduler.task.constraints.MonthConstraint.getMonth ( Date  date)

Definition at line 51 of file task/constraints/MonthConstraint.java.

51  {
52  Calendar c = Calendar.getInstance();
53  c.setTime(date);
54  return switch(c.get(Calendar.MONTH)) {
55  case Calendar.JANUARY -> Month.JANUARY;
56  case Calendar.FEBRUARY -> Month.FEBRUARY;
57  case Calendar.MARCH -> Month.MARCH;
58  case Calendar.APRIL -> Month.APRIL;
59  case Calendar.MAY -> Month.MAY;
60  case Calendar.JUNE-> Month.JUNE;
61  case Calendar.JULY -> Month.JULY;
62  case Calendar.AUGUST -> Month.AUGUST;
63  case Calendar.SEPTEMBER -> Month.SEPTEMBER;
64  case Calendar.OCTOBER -> Month.OCTOBER;
65  case Calendar.NOVEMBER -> Month.NOVEMBER;
66  case Calendar.DECEMBER -> Month.DECEMBER;
67  default -> null;
68  };
69  }
Here is the caller graph for this function:

◆ isValid()

boolean org.turro.scheduler.task.constraints.MonthConstraint.isValid ( Date  date)

Definition at line 34 of file task/constraints/MonthConstraint.java.

34  {
35  refresh = false;
36  Month m = getMonth(date);
37  if(m != null && contains(m)) {
38  refresh = !m.equals(lastCheck);
39  lastCheck = m;
40  return true;
41  }
42  lastCheck = m;
43  return isEmpty();
44  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ needsRefresh()

boolean org.turro.scheduler.task.constraints.MonthConstraint.needsRefresh ( )

Definition at line 46 of file task/constraints/MonthConstraint.java.

46  {
47  return refresh;
48  }
Here is the caller graph for this function:

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