@Test public void shouldEditLookups() { AdvancedSettingsDto advancedSettingsDto = advancedSettingsDto(); FieldHelper.setField(advancedSettingsDto, "indexes.0.lookupName", asList("newVal")); assertEquals("newVal", advancedSettingsDto.getIndexes().get(0).getLookupName()); FieldHelper.setField(advancedSettingsDto, "indexes.1.singleObjectReturn", asList(true)); assertTrue(advancedSettingsDto.getIndexes().get(1).isSingleObjectReturn()); }
public static void setField(Object current, String path, List value) { String[] splitPath = path.split("\\."); Object target = findTargetForField(current, splitPath); setFieldOnTarget(target, splitPath[splitPath.length - 1], value); }
FieldHelper { public static void setField(Object current, String path, List value) { String[] splitPath = path.split("\\."); Object target = findTargetForField(current, splitPath); setFieldOnTarget(target, splitPath[splitPath.length - 1], value); } }
FieldHelper { public static void setField(Object current, String path, List value) { String[] splitPath = path.split("\\."); Object target = findTargetForField(current, splitPath); setFieldOnTarget(target, splitPath[splitPath.length - 1], value); } private  FieldHelper(); }
FieldHelper { public static void setField(Object current, String path, List value) { String[] splitPath = path.split("\\."); Object target = findTargetForField(current, splitPath); setFieldOnTarget(target, splitPath[splitPath.length - 1], value); } private  FieldHelper(); static void setField(Object current, String path, List value); static Map<String, Field> fieldMapByName(Collection<Field> fields); static void addOrUpdateMetadataForCombobox(Field field); static void addMetadataForRelationship(String typeClass, Field field); static void createMetadataForManyToManyRelationship(Field field, String relatedClass, String collectionType,
                                                               String relatedField, boolean isOwningSide); static void setMetadataForManyToManyRelationship(Field field, boolean isOwningSide); }
FieldHelper { public static void setField(Object current, String path, List value) { String[] splitPath = path.split("\\."); Object target = findTargetForField(current, splitPath); setFieldOnTarget(target, splitPath[splitPath.length - 1], value); } private  FieldHelper(); static void setField(Object current, String path, List value); static Map<String, Field> fieldMapByName(Collection<Field> fields); static void addOrUpdateMetadataForCombobox(Field field); static void addMetadataForRelationship(String typeClass, Field field); static void createMetadataForManyToManyRelationship(Field field, String relatedClass, String collectionType,
                                                               String relatedField, boolean isOwningSide); static void setMetadataForManyToManyRelationship(Field field, boolean isOwningSide);  }