@Test public void testGetResourceName() throws Exception { TestResource resource = new TestResource(); Field field = resource.getClass().getDeclaredField("resource"); String name = HalReflectionHelper.getResourceName(field); Assert.assertEquals("resource", name); }
protected static String getResourceName(Field field) { String name = field.getName(); HalEmbedded annotation = field.getAnnotation(HalEmbedded.class); if (annotation != null) { if (annotation.name() != null && !annotation.name().trim().isEmpty()) { name = annotation.name(); } } return name; }
HalReflectionHelper { protected static String getResourceName(Field field) { String name = field.getName(); HalEmbedded annotation = field.getAnnotation(HalEmbedded.class); if (annotation != null) { if (annotation.name() != null && !annotation.name().trim().isEmpty()) { name = annotation.name(); } } return name; } }
HalReflectionHelper { protected static String getResourceName(Field field) { String name = field.getName(); HalEmbedded annotation = field.getAnnotation(HalEmbedded.class); if (annotation != null) { if (annotation.name() != null && !annotation.name().trim().isEmpty()) { name = annotation.name(); } } return name; }  }
HalReflectionHelper { protected static String getResourceName(Field field) { String name = field.getName(); HalEmbedded annotation = field.getAnnotation(HalEmbedded.class); if (annotation != null) { if (annotation.name() != null && !annotation.name().trim().isEmpty()) { name = annotation.name(); } } return name; }  static List<Field> getAllFields(Class<?> type); }
HalReflectionHelper { protected static String getResourceName(Field field) { String name = field.getName(); HalEmbedded annotation = field.getAnnotation(HalEmbedded.class); if (annotation != null) { if (annotation.name() != null && !annotation.name().trim().isEmpty()) { name = annotation.name(); } } return name; }  static List<Field> getAllFields(Class<?> type);  }