CPD Results

The following document contains the results of PMD's CPD 5.2.1.

Duplications

File Line
org/rundeck/api/domain/RundeckEvent.java 152
org/rundeck/api/domain/RundeckExecution.java 141
    }

    public Date getStartedAt() {
        return (startedAt != null) ? new Date(startedAt.getTime()) : null;
    }

    public void setStartedAt(Date startedAt) {
        this.startedAt = ((startedAt != null) ? new Date(startedAt.getTime()) : null);
    }

    public Date getEndedAt() {
        return (endedAt != null) ? new Date(endedAt.getTime()) : null;
    }

    public void setEndedAt(Date endedAt) {
        this.endedAt = ((endedAt != null) ? new Date(endedAt.getTime()) : null);
    }

    public String getAbortedBy() {
        return abortedBy;
    }

    public void setAbortedBy(String abortedBy) {
        this.abortedBy = abortedBy;
    }

    /**
     * @return the ID of the execution associated with this event, or null if there is not
     */
    public Long getExecutionId() {
File Line
org/rundeck/api/domain/RundeckEvent.java 60
org/rundeck/api/domain/RundeckExecution.java 63
    public Long getDurationInMillis() {
        if (startedAt == null || endedAt == null) {
            return null;
        }
        return endedAt.getTime() - startedAt.getTime();
    }

    /**
     * @return the duration of the event in seconds (or null if the dates are invalid)
     */
    public Long getDurationInSeconds() {
        Long durationInMillis = getDurationInMillis();
        return durationInMillis != null ? TimeUnit.MILLISECONDS.toSeconds(durationInMillis) : null;
    }

    /**
     * @return the duration of the event, as a human-readable string : "3 minutes 34 seconds" (or null if the dates are
     *         invalid)
     */
    public String getDuration() {
        Long durationInMillis = getDurationInMillis();
        return durationInMillis != null ? DurationFormatUtils.formatDurationWords(durationInMillis, true, true) : null;
    }

    /**
     * @return the duration of the event, as a "short" human-readable string : "0:03:34.187" (or null if the dates are
     *         invalid)
     */
    public String getShortDuration() {
        Long durationInMillis = getDurationInMillis();
        return durationInMillis != null ? DurationFormatUtils.formatDurationHMS(durationInMillis) : null;
    }

    /**
     * @return true if this event is for an ad-hoc command or script, false otherwise (for a job)
     */
    public boolean isAdhoc() {