@Test @DisplayName("creates the expected fingerprint for the methods") void testMethod2Fingerprint() throws NoSuchMethodException { Assertions.assertEquals("javax0.geci.jamal.util.TestEntityStringer|argless|", EntityStringer.method2Fingerprint(TestEntityStringer.class.getDeclaredMethod("argless"))); Assertions.assertEquals("javax0.geci.jamal.util.TestEntityStringer|arg1pri|int[][]", EntityStringer.method2Fingerprint(TestEntityStringer.class.getDeclaredMethod("arg1pri", int[][].class))); Assertions.assertEquals("javax0.geci.jamal.util.TestEntityStringer|arg1obj|java.lang.Integer", EntityStringer.method2Fingerprint(TestEntityStringer.class.getDeclaredMethod("arg1obj",Integer.class))); Assertions.assertEquals("javax0.geci.jamal.util.TestEntityStringer|arg1objarr|java.util.Map|java.util.Set[]", EntityStringer.method2Fingerprint(TestEntityStringer.class.getDeclaredMethod("arg1objarr",Map.class,Set[].class))); }
public static String method2Fingerprint(Method method) { final var className = method.getDeclaringClass().getCanonicalName(); final var argList = Arrays.stream(method.getGenericParameterTypes()) .map(Type::getTypeName) .collect(Collectors.joining("|")); return className + "|" + method.getName() + "|" + argList; }
EntityStringer { public static String method2Fingerprint(Method method) { final var className = method.getDeclaringClass().getCanonicalName(); final var argList = Arrays.stream(method.getGenericParameterTypes()) .map(Type::getTypeName) .collect(Collectors.joining("|")); return className + "|" + method.getName() + "|" + argList; } }
EntityStringer { public static String method2Fingerprint(Method method) { final var className = method.getDeclaringClass().getCanonicalName(); final var argList = Arrays.stream(method.getGenericParameterTypes()) .map(Type::getTypeName) .collect(Collectors.joining("|")); return className + "|" + method.getName() + "|" + argList; }  }
EntityStringer { public static String method2Fingerprint(Method method) { final var className = method.getDeclaringClass().getCanonicalName(); final var argList = Arrays.stream(method.getGenericParameterTypes()) .map(Type::getTypeName) .collect(Collectors.joining("|")); return className + "|" + method.getName() + "|" + argList; }  static String method2Fingerprint(Method method); static String field2Fingerprint(Field field); static Method fingerprint2Method(String fingerprint); static boolean isFingerPrintAField(String fingerPrint); static Field fingerprint2Field(String fingerprint); }
EntityStringer { public static String method2Fingerprint(Method method) { final var className = method.getDeclaringClass().getCanonicalName(); final var argList = Arrays.stream(method.getGenericParameterTypes()) .map(Type::getTypeName) .collect(Collectors.joining("|")); return className + "|" + method.getName() + "|" + argList; }  static String method2Fingerprint(Method method); static String field2Fingerprint(Field field); static Method fingerprint2Method(String fingerprint); static boolean isFingerPrintAField(String fingerPrint); static Field fingerprint2Field(String fingerprint);  }