mirror of
https://github.com/valitydev/geck.git
synced 2024-11-06 09:45:24 +00:00
BJ-88: Add kebab map (#12)
This commit is contained in:
parent
eb1f39563b
commit
4cab483c72
@ -1,9 +1,6 @@
|
||||
package com.rbkmoney.kebab;
|
||||
|
||||
import com.rbkmoney.kebab.test.Fail;
|
||||
import com.rbkmoney.kebab.test.Ids;
|
||||
import com.rbkmoney.kebab.test.Status;
|
||||
import com.rbkmoney.kebab.test.TestObject;
|
||||
import com.rbkmoney.kebab.test.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.IntFunction;
|
||||
@ -55,6 +52,44 @@ public class KebabUtil {
|
||||
testObject.setMaps(map);
|
||||
|
||||
testObject.setStatus(Status.fail(new Fail(fail)));
|
||||
|
||||
List<Status> lists = Collections.nCopies(10, Status.unknown(new Unknown("SomeData")));
|
||||
testObject.setStatuses(lists);
|
||||
|
||||
testObject.setActive(true);
|
||||
|
||||
Map<Map<Set<Kek>, Status>, Map<Status, Set<Ids>>> kebabMap = new HashMap<>();
|
||||
|
||||
Map<Set<Kek>, Status> key = new HashMap<>();
|
||||
|
||||
Set<Kek> keyKey = new HashSet<>();
|
||||
keyKey.add(Kek.TEST1);
|
||||
keyKey.add(Kek.TEST2);
|
||||
keyKey.add(Kek.TEST3);
|
||||
|
||||
Status status = Status.ok(new Ok());
|
||||
key.put(keyKey, status);
|
||||
|
||||
Map<Status, Set<Ids>> value = new HashMap<>();
|
||||
Fail failKey = new Fail();
|
||||
failKey.setReasons(new HashSet<>(Arrays.asList("qwe", "aasd", "ads")));
|
||||
|
||||
|
||||
Set<Ids> valueIds = new HashSet<>();
|
||||
valueIds.add(ids);
|
||||
|
||||
Ids idsTwo = new Ids();
|
||||
idsTwo.setBigId(123123);
|
||||
idsTwo.setId(44);
|
||||
idsTwo.setMiniId((short) 2334);
|
||||
idsTwo.setMicroId((byte) 12);
|
||||
valueIds.add(idsTwo);
|
||||
value.put(Status.fail(failKey), valueIds);
|
||||
|
||||
kebabMap.put(key, value);
|
||||
|
||||
testObject.setKebabMap(kebabMap);
|
||||
|
||||
return testObject;
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,9 @@ struct TestObject {
|
||||
6: required Status status
|
||||
7: required list<set<string>> fuck
|
||||
8: optional map<string, i32> maps
|
||||
9: optional list<Status> statuses;
|
||||
9: optional list<Status> statuses
|
||||
10: required bool active
|
||||
11: required map<map<set<Kek>, Status>, map<Status, set<Ids>>> kebabMap
|
||||
}
|
||||
|
||||
union Status {
|
||||
@ -30,6 +32,10 @@ struct Ok {
|
||||
|
||||
}
|
||||
|
||||
enum Kek {
|
||||
TEST1, TEST2, TEST3
|
||||
}
|
||||
|
||||
struct Ids {
|
||||
1: required i8 micro_id
|
||||
2: required i16 mini_id
|
||||
|
Loading…
Reference in New Issue
Block a user