|
|
|
@ -10,11 +10,13 @@ public class Mapper {
|
|
|
|
|
object = aClass.getConstructor().newInstance(); |
|
|
|
|
Field[] sourceFields = source.getClass().getDeclaredFields(); |
|
|
|
|
for (Field sourceField : sourceFields) { |
|
|
|
|
if (!sourceField.isSynthetic()) { |
|
|
|
|
sourceField.setAccessible(true); |
|
|
|
|
Field destinationField = object.getClass().getDeclaredField(sourceField.getName()); |
|
|
|
|
destinationField.setAccessible(true); |
|
|
|
|
destinationField.set(object, sourceField.get(source)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} catch (NoSuchFieldException ignored) { |
|
|
|
|