Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
FriggaHel committed May 3, 2024
1 parent a96e3ef commit 121eb50
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions visual-java/src/main/java/com/saucelabs/visual/VisualApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,22 +396,24 @@ private DiffingOptionsIn.Builder setDiffingOptionValue(

private DiffingOptionsIn generateDiffingOptions(
List<String> enableOnly, List<String> disableOnly) {
if (enableOnly != null && !enableOnly.isEmpty()) {
DiffingOptionsIn.Builder builder = DiffingOptionsIn.builder();
if (enableOnly != null && disableOnly != null) {
return null;
}

DiffingOptionsIn.Builder builder = DiffingOptionsIn.builder();

if (enableOnly != null) {
for (String option : DiffingOptionValues) {
setDiffingOptionValue(builder, option, enableOnly.contains(option));
}
return builder.build();
}

if (disableOnly != null && !disableOnly.isEmpty()) {
DiffingOptionsIn.Builder builder = DiffingOptionsIn.builder();
if (disableOnly != null) {
for (String option : DiffingOptionValues) {
setDiffingOptionValue(builder, option, !disableOnly.contains(option));
}
return builder.build();
}
return null;
return builder.build();
}

private static DiffingMethod toDiffingMethod(CheckOptions options) {
Expand Down

0 comments on commit 121eb50

Please sign in to comment.