Skip to content
This repository was archived by the owner on Jun 6, 2025. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions core/src/main/java/uk/gov/gchq/koryphe/impl/predicate/IsIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;

/**
Expand All @@ -47,11 +48,12 @@ public IsIn() {
}

public IsIn(final Collection<Object> controlData) {
this.allowedValues = new HashSet<>(controlData);
this.allowedValues = new LinkedHashSet<>(controlData);
}

public IsIn(final Object... controlData) {
this.allowedValues = Sets.newHashSet(controlData);
this.allowedValues = Sets.newLinkedHashSet();
Collections.addAll(this.allowedValues, controlData);
}

@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.WRAPPER_OBJECT)
Expand All @@ -64,9 +66,9 @@ public Object[] getAllowedValuesArray() {
@JsonProperty("values")
public void setAllowedValues(final Object[] allowedValuesArray) {
if (null != allowedValuesArray) {
allowedValues = new HashSet<>(Arrays.asList(allowedValuesArray));
allowedValues = new LinkedHashSet<>(Arrays.asList(allowedValuesArray));
} else {
allowedValues = new HashSet<>(0);
allowedValues = new LinkedHashSet<>(0);
}
}

Expand Down