@Test public void shouldSetCorrectValuesForFields() { FieldDto field = fieldDto(); FieldHelper.setField(field, "basic.displayName", asList("newDispName")); assertEquals("newDispName", field.getBasic().getDisplayName()); FieldHelper.setField(field, "basic.tooltip", asList("newTooltip")); assertEquals("newTooltip", field.getBasic().getTooltip()); FieldHelper.setField(field, "basic.placeholder", asList("newPlaceholder")); assertEquals("newPlaceholder", field.getBasic().getPlaceholder()); FieldHelper.setField(field, "metadata.0.key", asList("newKey")); assertEquals("newKey", field.getMetadata().get(0).getKey()); }
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);  }