Add support for separate story view receipt control.

This reverts commit 1046265d23.
This commit is contained in:
Alex Hart
2022-10-13 12:46:13 -03:00
committed by Cody Henthorne
parent 2f2711c9a3
commit ca36eaacce
23 changed files with 332 additions and 48 deletions

View File

@@ -120,6 +120,18 @@ public class Data {
return integerArrays.get(key);
}
public List<Integer> getIntegerArrayAsList(@NonNull String key) {
throwIfAbsent(integerArrays, key);
int[] array = Objects.requireNonNull(integerArrays.get(key));
List<Integer> ints = new ArrayList<>(array.length);
for (int l : array) {
ints.add(l);
}
return ints;
}
public boolean hasLong(@NonNull String key) {
return longs.containsKey(key);
@@ -295,6 +307,17 @@ public class Data {
return this;
}
public Builder putIntegerListAsArray(@NonNull String key, @NonNull List<Integer> value) {
int[] ints = new int[value.size()];
for (int i = 0; i < value.size(); i++) {
ints[i] = value.get(i);
}
integerArrays.put(key, ints);
return this;
}
public Builder putInt(@NonNull String key, int value) {
integers.put(key, value);
return this;