Example usage for org.joda.time Duration isEqual

List of usage examples for org.joda.time Duration isEqual

Introduction

In this page you can find the example usage for org.joda.time Duration isEqual.

Prototype

public boolean isEqual(ReadableDuration duration) 

Source Link

Document

Is the length of this duration equal to the duration passed in.

Usage

From source file:org.smartdeveloperhub.harvesters.it.testing.generator.ProjectActivityGenerator.java

License:Apache License

private void estimateIssue(final Issue issue, final Set<Item> changes, final LocalDateTime now) {
    final LocalDateTime dueTo = Utils.toLocalDateTime(issue.getDueTo());
    final Duration oldValue = issue.getEstimatedTime();
    Duration newValue = null;
    do {/*from  w  ww.j a v a  2s.  c om*/
        newValue = estimateEffort(now, dueTo);
        if (MINIMUM_EFFORT.isEqual(newValue) && MINIMUM_EFFORT.isEqual(oldValue)) {
            return;
        }
    } while (newValue.isEqual(oldValue));

    issue.setEstimatedTime(newValue);

    final EstimatedTimeChangeItem item = new EstimatedTimeChangeItem();
    item.setOldValue(oldValue);
    item.setNewValue(newValue);
    changes.add(item);

    if (oldValue == null) {
        LOGGER.trace("     + Estimated {} hours", newValue.getStandardHours());
    } else {
        LOGGER.trace("     + Reestimated from {} to {} hours", oldValue.getStandardHours(),
                newValue.getStandardHours());
    }
}