Skip to content

Commit

Permalink
Reorder constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Enes Özel committed Dec 4, 2019
1 parent 50ae8fc commit 81c0999
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/main/java/de/retest/recheck/report/ActionReplayResult.java
Expand Up @@ -72,9 +72,22 @@ protected ActionReplayResult() {
windows = null;
}

protected ActionReplayResult( final ActionReplayData data, final WindowRetriever windows,
final DifferenceRetriever difference, final long duration ) {
if ( windows.isNull() && difference.isNull() ) {
throw new NullPointerException(
"ActionReplayResult must not be empty! Affected action: " + data.getDescription() + "." );
}
description = data.getDescription();
goldenMasterPath = data.getGoldenMasterPath();
targetcomponent = data.getElement();
this.windows = windows.get();
stateDifference = difference.get();
this.duration = duration;
}

public static ActionReplayResult createActionReplayResult( final ActionReplayData data,
final StateDifference difference, final long actualDuration, final SutState actualState ) {

if ( difference != null && !difference.getRootElementDifferences().isEmpty() ) {
return withDifference( data, WindowRetriever.empty(), DifferenceRetriever.of( difference ),
actualDuration );
Expand All @@ -92,20 +105,6 @@ public static ActionReplayResult withoutDifference( final ActionReplayData data,
return withDifference( data, windows, DifferenceRetriever.empty(), duration );
}

protected ActionReplayResult( final ActionReplayData data, final WindowRetriever windows,
final DifferenceRetriever difference, final long duration ) {
if ( windows.isNull() && difference.isNull() ) {
throw new NullPointerException(
"ActionReplayResult must not be empty! Affected action: " + data.getDescription() + "." );
}
description = data.getDescription();
goldenMasterPath = data.getGoldenMasterPath();
targetcomponent = data.getElement();
this.windows = windows.get();
stateDifference = difference.get();
this.duration = duration;
}

public StateDifference getStateDifference() {
return stateDifference;
}
Expand Down

0 comments on commit 81c0999

Please sign in to comment.