Commit 01b96191 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko

Merge branch 'ltl-components' into 'master'

Ltl components

See merge request !11
parents ac277d96 248a77a2
Pipeline #362585 passed with stage
in 31 seconds
......@@ -8,7 +8,7 @@
<groupId>montisim</groupId>
<artifactId>commons</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
<properties>
......
package de.rwth.montisim.commons.utils;
public enum Comparator {
LESS, LESS_EQUAL, GREATER, GREATER_EQUAL, EQUAL
}
package de.rwth.montisim.commons.utils;
public enum LTLOperator {
ALWAYS, NEVER, EVENTUALLY, UNTIL
}
......@@ -9,11 +9,7 @@ import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.time.Duration;
import java.time.Instant;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Optional;
import java.util.Stack;
import java.util.Vector;
import java.util.*;
import de.rwth.montisim.commons.utils.*;
import de.rwth.montisim.commons.utils.json.JsonTraverser.*;
......@@ -1021,5 +1017,21 @@ public abstract class Json {
}
}
);
registerGeneric(List.class, (j, o, c) -> {
List list = (List) o;
j.startArray();
Iterator it = list.iterator();
while (it.hasNext()) {
Json.toJson(j, it.next(), c);
}
j.endArray();
},
(t, o, it, generics, context) -> {
List list = (List)o;
for (ValueType vt : t.streamArray()){
list.add(Json.instantiateFromJson(t, (Class<?>)generics[0], context));
}
}
);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment