Commit d070b811 authored by Sergey Tselovalnikov's avatar Sergey Tselovalnikov
Browse files

Fixes

parent c69aa16b
Showing with 11 additions and 1 deletion
+11 -1
......@@ -92,7 +92,7 @@ public object ModelMapper {
throw RuntimeException("No getter presents for field ${it.getName()}");
}
sb.append(";\n")
if (it.getType() !in Primitives.TYPES) sb.append("if ($varName != null)\n")
if (it.getType() !in Primitives.JAVA_PRIMITIVES) sb.append("if ($varName != null)\n")
sb.append("map.put(\"${it.getName()}\", ${ModelMapper::class.java.getName()}.map($varName));\n");
sb.toString()
}.join("")
......
......@@ -32,6 +32,16 @@ public class Primitives {
short.class, Short.class,
String.class));
public static final List<? extends Class<?>> JAVA_PRIMITIVES = Collections.unmodifiableList(asList(
boolean.class,
byte.class,
char.class,
double.class,
float.class,
int.class,
long.class,
short.class));
private Primitives() {
}
}
Supports Markdown
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