Skip to content

Commit 9207916

Browse files
used primitive array
1 parent 2f62162 commit 9207916

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/main/java/com/uid2/operator/model/IdentityMapRequest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
package com.uid2.operator.model;
22

33
import com.fasterxml.jackson.annotation.*;
4-
import java.util.List;
54

65
public record IdentityMapRequest (
76
@JsonSetter(contentNulls = Nulls.FAIL)
8-
@JsonProperty("email") List<IdentityInput>email,
7+
@JsonProperty("email") IdentityInput[] email,
98

109
@JsonSetter(contentNulls = Nulls.FAIL)
11-
@JsonProperty("email_hash") List<IdentityInput> email_hash,
10+
@JsonProperty("email_hash") IdentityInput[] email_hash,
1211

1312
@JsonSetter(contentNulls = Nulls.FAIL)
14-
@JsonProperty("phone") List<IdentityInput> phone,
13+
@JsonProperty("phone") IdentityInput[] phone,
1514

1615
@JsonSetter(contentNulls = Nulls.FAIL)
17-
@JsonProperty("phone_hash") List<IdentityInput> phone_hash
16+
@JsonProperty("phone_hash") IdentityInput[] phone_hash
1817
){
1918
public record IdentityInput(
2019
@JsonSetter(nulls = Nulls.FAIL)

src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,14 +2081,14 @@ private InputUtil.InputVal normalizeIdentity(String identity, IdentityType ident
20812081
};
20822082
}
20832083

2084-
private InputUtil.InputVal[] parseIdentitiesInput(List<IdentityMapRequest.IdentityInput> identities, IdentityType identityType, InputUtil.IdentityInputType inputType, RoutingContext rc) {
2085-
if (identities == null || identities.isEmpty()) {
2084+
private InputUtil.InputVal[] parseIdentitiesInput(IdentityMapRequest.IdentityInput[] identities, IdentityType identityType, InputUtil.IdentityInputType inputType, RoutingContext rc) {
2085+
if (identities == null || identities.length == 0) {
20862086
return new InputUtil.InputVal[0];
20872087
}
2088-
final var normalizedIdentities = new InputUtil.InputVal[identities.size()];
2088+
final var normalizedIdentities = new InputUtil.InputVal[identities.length];
20892089

2090-
for (int i = 0; i < identities.size(); i++) {
2091-
final var identity = identities.get(i);
2090+
for (int i = 0; i < identities.length; i++) {
2091+
final var identity = identities[i];
20922092
normalizedIdentities[i] = normalizeIdentity(identity.input(), identityType, inputType);
20932093
}
20942094
return normalizedIdentities;

0 commit comments

Comments
 (0)