ItEr33S14CUCreacionUnidadesPlanificacion: Adding methods to update safely the values of TaskStartConstraint.
This commit is contained in:
parent
40d74b8784
commit
9001fc2fca
1 changed files with 11 additions and 0 deletions
|
|
@ -59,4 +59,15 @@ public class TaskStartConstraint {
|
|||
this.startConstraintType = StartConstraintType.START_NOT_EARLIER_THAN;
|
||||
}
|
||||
|
||||
public boolean isValid(StartConstraintType type, Date value) {
|
||||
return type != null
|
||||
&& type.isAssociatedDateRequired() == (value != null);
|
||||
}
|
||||
|
||||
public void update(StartConstraintType type, Date value) {
|
||||
Validate.isTrue(isValid(type, value));
|
||||
this.startConstraintType = type;
|
||||
this.constraintDate = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue