Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 3f38b59

Browse files
committed
add LDUser.custom(String, List<Integer>)
1 parent 6c1d9b0 commit 3f38b59

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/main/java/com/launchdarkly/client/LDUser.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,23 @@ public Builder custom(String k, List<String> vs) {
302302
custom.put(k, array);
303303
return this;
304304
}
305+
306+
/**
307+
* Add a list of {@link java.lang.Integer}-valued custom attributes
308+
* @param k the key for the list
309+
* @param vs the values for the attribute
310+
* @return the builder
311+
*/
312+
public Builder custom(String k, List<Integer> vs) {
313+
JsonArray array = new JsonArray();
314+
for (Integer v : vs) {
315+
if (v != null) {
316+
array.add(new JsonPrimitive(v));
317+
}
318+
}
319+
custom.put(k, array);
320+
return this;
321+
}
305322

306323
/**
307324
* Build the configured {@link com.launchdarkly.client.LDUser} object

0 commit comments

Comments
 (0)